I am displaying an icon in the status bar. Now I want to remove that icon immediately when I open that material, after some time if we get a warning, then that icon will be displayed again How can I do it?
Use the notification manager to cancel your notification. You only need to provide your notification ID.
Private static final full MY_NOTIFICATION_ID = 1234; String NS = Reference. NETIFICATION_SERVICE; Information manager manager information manager; MNotificationManager = (NotificationManager) getSystemService (ns); MNotificationManager.notify (MY_NOTIFICATION_ID, Notification);
The example code is not complete. It depends on how you have made your notice, make sure that you use the same ID to cancel your notice when you made your notice.
To cancel:
mNotificationManager.cancel (MY_NOTIFICATION_ID);
Comments
Post a Comment