I want to remove all cancelable notifications from status bar. I know how to remove my app notifications I have seen this post before, butI want to remove other apps notifications.
There is a "Clear" button in notifications in all android versions which clears all notifications with this flag: Notification.FLAG_AUTO_CANCEL
That means it's possible to cancel all notifications. But I haven't found any document about how to do that. Is there anybody guide me how to do that?
Thanks
To remove all notifications:
Kotlin
val NM = getSystemService(AppCompatActivity.NOTIFICATION_SERVICE) as NotificationManager
NM.cancelAll()
Java
NotificationManager NM = getSystemService(AppCompatActivity.NOTIFICATION_SERVICE)
NM.cancelAll()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With