Share via


NotificationListenerService.SnoozeNotification(String, Int64) Method

Definition

Inform the notification manager about snoozing a specific notification.

[Android.Runtime.Register("snoozeNotification", "(Ljava/lang/String;J)V", "", ApiSince=26)]
public void SnoozeNotification (string? key, long durationMs);
[<Android.Runtime.Register("snoozeNotification", "(Ljava/lang/String;J)V", "", ApiSince=26)>]
member this.SnoozeNotification : string * int64 -> unit

Parameters

key
String

The key of the notification to snooze

durationMs
Int64

A duration to snooze the notification for, in milliseconds.

Attributes

Remarks

Inform the notification manager about snoozing a specific notification.

Use this if your listener has a user interface that allows the user to snooze a notification for a time. It should be called after the user snoozes a single notification using your UI; upon being informed, the notification manager will actually remove the notification and you will get an #onNotificationRemoved(StatusBarNotification) callback. When the snoozing period expires, you will get a #onNotificationPosted(StatusBarNotification, RankingMap) callback for the notification.

Java documentation for android.service.notification.NotificationListenerService.snoozeNotification(java.lang.String, long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to