I have a notification in my app with the following code:
//Notification Start
notificationManager = (NotificationManager) getSystemService(Context.NOTIFI
public static void notifyUser(Activity activity, String header,
String message) {
NotificationManager notificationManager = (NotificationManager) activity
.getSystemService(Activity.NOTIFICATION_SERVICE);
Intent notificationIntent = new Intent(
activity.getApplicationContext(), YourActivityToLaunch.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(activity);
stackBuilder.addParentStack(YourActivityToLaunch.class);
stackBuilder.addNextIntent(notificationIntent);
PendingIntent pIntent = stackBuilder.getPendingIntent(0,
PendingIntent.FLAG_UPDATE_CURRENT);
Notification notification = new Notification.Builder(activity)
.setContentTitle(header)
.setContentText(message)
.setDefaults(
Notification.DEFAULT_SOUND
| Notification.DEFAULT_VIBRATE)
.setContentIntent(pIntent).setAutoCancel(true)
.setSmallIcon(drawable.notification_icon).build();
notificationManager.notify(2, notification);
}