views:

659

answers:

2

Is it possible to clear a notification programatically?

I tried it with the NotificationManager but its not working. Is there any other way i can do it?

+3  A: 

From: http://developer.android.com/guide/topics/ui/notifiers/notifications.html

To clear the status bar notification when the user selects it from the Notifications window, add the "FLAG_AUTO_CANCEL" flag to your Notification object. You can also clear it manually with cancel(int), passing it the notification ID, or clear all your Notifications with cancelAll().

But Donal is right, you can only clear notifications that you created.

Chuck C.
A: 

You need to store an id value associated with the notification when it is open. Have you page call close using the same id.

I will post code sample later

xximjasonxx