How do I clear all notifications with separate app?
-
29-06-2021 - |
Вопрос
Is it possible to make an icon on android that when clicked clears all notifications, e.g. SMS, email, missed calls etc? I just want an icon on my home screen that clears all notifications. What coding would I use?
Решение
You can only remove a Notification
that you raise yourself. You cannot remove a Notification
raised by another application.
Другие советы
cancel(notificationID)
where you pass the notification id of the notification you have created
or else, you can clear all your notifications by cancelAll()
.
*NOTE : * Only notifications created by your application can be deleted. You cannot remove notifications created by some other application.
Не связан с StackOverflow