1

Hai i want to create number notification dynamically,i can able to create single notification only.Am searching and get answer in this forum How to create Multiple statusbar Notifications in android but here the notification is mentiones.but i need dynamic multiple notification depend on number.

Suppose i have number=1 i need 1 notification,if number=2 i need 2 notification how to do this.kindly guide me?See my image if anybody dont understand my question kindly ask me?

enter image description here

Community
  • 1
  • 1
user1324068
  • 267
  • 3
  • 7
  • 17
  • 1
    possible duplicate of [How to add multiple number of notifications in android?](http://stackoverflow.com/questions/10532748/how-to-add-multiple-number-of-notifications-in-android) – CommonsWare May 10 '12 at 13:25
  • @CommonsWare Sorry NoBody replies me So only i post again.Can you Guide me please – user1324068 May 10 '12 at 13:30

1 Answers1

1

The link above shows how to send a notification:

mNotificationManager.notify(id, notifyDetails);

And set the id to be different each time, for instance if you want 5 notifications, you could try something like:

for(int id = 0; id < 5; id++){mNotificationManager.notify(id, notifyDetails);}

Carnal
  • 21,744
  • 6
  • 60
  • 75
  • ya Thank you its working,Suppose i want to dispaly the Different message for different id – user1324068 May 10 '12 at 13:59
  • 1
    put: notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent); as well in the loop, and change the contentText each time. – Carnal May 10 '12 at 14:03
  • 1
    you'll need some kind of algoritm. If (id == 0) contentText = "msg1" and so on – Carnal May 10 '12 at 14:04