2

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?

Michael Spitsin
  • 2,539
  • 2
  • 19
  • 29
s.k.paul
  • 7,099
  • 28
  • 93
  • 168

2 Answers2

5

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

Yoni
  • 1,346
  • 3
  • 16
  • 38
1

According to notify documentation if you want always the same 3 notifications all the time try using unique tags. It's the combination of tag and id that makes the notification "overwrite" the previous one.

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

or

mNotificationManager.notify("My App Name",1212,notification);
mNotificationManager.notify("My App Name",1213,notification);
mNotificationManager.notify("My App Name",1214,notification);
Fabio
  • 2,654
  • 16
  • 31