Start a Project

Updating Notifications to show stacked notification contents

Many of us have used notifications in our android application but do you know we can update those shown notification in our application. When we make a notification we passes an Id in the notify(), as the syntax is

Its an unique id and its unique within your application, so when you passes another notification with the same id it overrides the previous one and creates a new notification.

So if we wanted a stacked notification of various events we have to

and then when you have a new message to show, the append it in setContentText() to show stacked messages in a notification.

Exit mobile version