Before
Notification.Builder
came into existence the way to update a notification that was already in the notification tray was to callsetLatestEventInfo()
and then send the notification back through theNotificationManager.notify()
call with an ID that matches the firstnotify()
call you made.Now
setLatestEventInfo()
is deprecated with the message:Use Notification.Builder
instead. But I cannot find any documentation about how to properly update a notification usingNotification.Builder
.Are you just suppose to recreate a new
Notification
instance every time you need to update the notification? Then simply pass that toNotificationManager.notify()
with the ID you used before?It seems to work but I wanted to see if anyone had any official verification that this is the new "way to do this"?
There real reason I am asking this is because in Android 4.1.1 Jelly Bean
, the notification now flashes everytime notify()
is called. When updating a progress bar with setProgress()
this looks really bad and makes it hard to tap on the notification. This was not the case in 4.1 or previous versions. So I want to make sure I am doing this correctly before I file a bug.