Search code examples
androidandroid-notificationsandroid-statusbar

Multiple notification by NotificationManager


Currently I notifying user as -

mNotificationManager.notify("My App Name",1212,notification);

This is working nicely. But it shows only one icon in status bar, though I sent multiple notification on different times.

I would like to show icon for each notification (i.e. 3 icons).

I am not sure whether it's possible. Any clue?


Solution

  • try this:

    mNotificationManager.notify("My App Name",(int)(Math.random() * 101),notification);
    

    *same id on notification change always the last one

    *different id create a new notification