Im using an <NotificationListenerService >for snoo...
# android
r
Im using an NotificationListenerService for snoozing certain notifications on condition X by calling snoozeNotification(id, duration). When condition X changes during the snooze periode, how do you 'unsnooze' such a notification?
You can query a list of all the snoozed notifications by calling the getSnoozedNotifications function. But unsure which property on the
Notification
object inside the
StatusbarNotification
object I would need to call/set. Any one a clue?
My notifications now remain snoozed until the duration is over or the phone reboots, even if condition X has changed.
f
Isn't it .cancel() ?
r
.cancel() on what object? doesn't seem to be one on either
Notification
or
StatusbarNotification
f
I meant Notification. Hmmm I remember that some time back i had similar issue and calling cancel on Notification object was the solution. I need to check it again
r
you can call
cancelNotification()
image.png
but this just cancels the notification, I want the opposite behavior, to basically 'uncancel' the snooze periode
wait, maybe when I set the snooze duration to 0?
nice, this works 🙂
2021-01-25_09h24_48.png
just call
snoozeNotification()
with duration 0, and your notification becomes visible again.
@Farhad could you check your code? It's still inconsistent when I call
snoozeNotification(0)