How to clear alarm notification on status bar - android

Hi, I used parsing push notifications in an Android app.

I do not use noraml notification. I have a parsing notification. Notification notification comes from server

Device

successfully received a push notification.

for example, I received 10 notifications from the server, if I opened one notification on my device, the application opened and one notification was deleted.

My question is:

how to clear the remaining 9 push alert alerts in the status bar when a single notification is opened. ?

+4
source share
2 answers

Android.app.NotificationManager.cancelAll () does not work?

If you need to do something very ordinary, you can use ParsePush to run Intent, and not to create Notification. Then you can use the BroadcastReceiver to create notifications with non-standard behavior (i.e., Custom styling, firing everyone during interaction, etc.).

+4
source

Use this at startup:

String ns = getActivity().NOTIFICATION_SERVICE; NotificationManager nMgr = (NotificationManager) getActivity().getSystemService(ns); nMgr.cancelAll(); 
0
source

All Articles