1
 private void triggerNotification(String s)     
{         
    CharSequence title = "TASK";         
    CharSequence message = s;    

    notificationManager = (NotificationManager)c.getSystemService(Context.NOTIFICATION_SERVICE);         
    Notification notification = new Notification(R.drawable.vianetlogo, s, System.currentTimeMillis());  

    notification.defaults |= Notification.DEFAULT_SOUND;
    notification.defaults |= Notification.DEFAULT_VIBRATE;

    PendingIntent pendingIntent = PendingIntent.getActivity(c, 0, null, 0); 

    notification.setLatestEventInfo(c, title, message, pendingIntent);  
    notificationManager.notify(NOTIFICATION_ID, notification);    
} 

Here it's saving the last notification in status bar if there are mutiple notifications at the same time. Is there any way that it will save mutiple notifications on status bar ?

user533844
  • 2,053
  • 7
  • 36
  • 43

1 Answers1

0

your answer is here :

If the PendingIntent has the same operation, action, data, categories, components, and flags it will be replaced.

Depending on the situation i usually solve this by providing a unique request code either as static values (0,1,2) or the row id of the data I'm receiving from the DB.

Community
  • 1
  • 1
A.Quiroga
  • 5,704
  • 6
  • 37
  • 58