/*
 * Copyright (c) 2014, Araz Abishov
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * 3. Neither the name of the copyright holder nor the names of its contributors
 * may be used to endorse or promote products derived from this software
 * without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.dhis2.mobile.utils;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;

import org.dhis2.mobile.R;
import org.dhis2.mobile.ui.activities.LauncherActivity;

public class NotificationBuilder {
	private NotificationBuilder() { }
	
	public static void fireNotification(Context context, String title, String message) {
		int id = (title + message).hashCode();
		Intent notificationIntent = new Intent(context, LauncherActivity.class);
		PendingIntent contentIntent = PendingIntent.getActivity(context,
		        id, notificationIntent,
		        PendingIntent.FLAG_CANCEL_CURRENT);
		
		 Notification notification = new  NotificationCompat.Builder(context)
		 		.setContentIntent(contentIntent)
				.setContentTitle(title)
				.setContentText(message)
				.setSmallIcon(R.drawable.ic_notification)
				.setAutoCancel(true)
				.build(); 

		NotificationManager notificationManager = (NotificationManager) context
				.getSystemService(Activity.NOTIFICATION_SERVICE);
		notification.flags |=  Notification.FLAG_AUTO_CANCEL;
		
		notificationManager.notify(id, notification);
	}

}

@@ -1589,16 +1589,100 @@
 utils;%0A%0A
+import org.dhis2.mobile.ui.activities.LauncherActivity;%0Aimport org.dhis2.mobile.R;%0A%0A
 import a
@@ -1927,92 +1927,8 @@
 t;%0A%0A
-import org.dhis2.mobile.R;%0Aimport org.dhis2.mobile.ui.activities.LauncherActivity;%0A%0A
 publ

Fix typo