androidnotificationsandroid-3.0-honeycomb

Updating an ongoing notification quietly


I have a service which connects to other devices wirelessly. When the service is enabled, I have an ongoing notification which states it is enabled.

After the service is enabled, the user then connects to another device. At this point, I would like to update my ongoing notification to state the name of the device which has been connected to. This is easy enough to do by calling startForeground(ONGOING_NOTIFICATION, notification) again with the updated information; however this flashes the notification on the bar each time it is called. What I would really like is the notification to quietly update in the background without flashing on the notification bar so the user doesn't know the difference until he or she opens the notification area to look.

Is there someway to update the notification without calling startForeground()?

This behavior only occurs in Honeycomb. Gingerbread devices (and I assume Froyo, etc.) behave the desired way.


Solution

  • You should update existing notification as per the docs.