I was able to send a notification to the Android emulator. When I click on it, the activity opens. But the notification alone remains in status bar. Normally, when you get sms/notifications and click on them, you go to the particular activity and when you expand the status bar, you don’t see the notifications, on which you have already clicked.
So, my question is – how can I make the notification dissapear after clicking on it? Is there a special function for this? Thanks.
I was able to send a notification to the Android emulator. When I click
Share
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().
Reference – http://developer.android.com/guide/topics/ui/notifiers/notifications.html