I am making a chat application, I have requirement when the User is logged out of the application, then all the notifications of my application should be removed from the notification bar.
Is it possible??
Thanks
I am making a chat application, I have requirement when the User is logged out of the application, then all the notifications of my application should be removed from the notification bar.
Is it possible??
Thanks
I believe this would do the trick:
http://developer.android.com/reference/android/app/NotificationManager.html#cancelAll()
Or you can cancel them by ID also:
http://developer.android.com/reference/android/app/NotificationManager.html#cancel(int)
Yes, use NotificationManager.cancelAll()
http://developer.android.com/reference/android/app/NotificationManager.html#cancelAll()
Yes,Take a look here:
Remove the notification icon from the status bar
You only need to provide your notification id; to remove only the notifications of your aplication.
When the user logged out or the activity goes to onPause() or onStop() (Depends of your necessity) you use:
public void cancel (String tag, int id)
Cancel a previously shown notification. If it's transient, the view will be hidden. If it's persistent, it will be removed from the status bar.