Home:ALL Converter>How to stack notifications on Jelly Bean?

How to stack notifications on Jelly Bean?

Ask Time:2012-08-17T22:22:07         Author:Markus Rudel

Json Formatter

following my previous notification problems I wanted to test the new notification stack feature of Jelly Bean 4.1 as it is described here. I already found out, that notifications need to have different IDs, otherwise the older notification will just be updated with the content of the second notification. If I use different IDs, my Notifications will just be a list:

Notification List

The small secondary icon is set with setSmallIcon() (see my first notification on the screenshot above), while the larger icon is set with setLargeIcon(). What I cannot control is when the number of pending notifications will be displayed. It is not controlled by the text lines mentioned in my other question.

So my guess is, that Jelly Bean will take care automatically of multiple notifications, but how can I trigger this? Maybe someone can give me a piece of code or a hint in the documentation.

Author:Markus Rudel,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12007607/how-to-stack-notifications-on-jelly-bean
CommonsWare :

You wrote the answer in your question: \"otherwise the older notification will just be updated with the content of the second notification\". However, your app needs to have the smarts to know what the \"second notification\" should show, to cover all events since the last time the user interacted with your app. Then, the \"second notification\" can contain information about both events, not just the second one.",
2012-08-17T15:04:01
yy