androidnotificationsnotificationmanager

Temporarily hide notifications of other apps in Android


I'm looking to manage the visible notifications of other apps. It looks like I can cancel notifications with a NotificationListenerService. Is there a way to only do so temporarily, and then show them again at a later time?

Until now I've been turning on DND to do this, but that hides all notifications (or whatever the user has configured DND to do). I'd like to give them the choice of what app notifications to hide, temporarily.

Would snoozeNotification do what I'm looking for? How would you then un-snooze a notification at a later time?


Solution

  • It looks like calling snoozeNotification again with a short duration works to re-issue the notification!