NotificationManager.GetActiveNotifications Method

Definition

Recover a list of active notifications: ones that have been posted by the calling app that have not yet been dismissed by the user or #cancel(String, int)ed by the app.

[Android.Runtime.Register("getActiveNotifications", "()[Landroid/service/notification/StatusBarNotification;", "GetGetActiveNotificationsHandler", ApiSince=23)]
public virtual Android.Service.Notification.StatusBarNotification[]? GetActiveNotifications ();
[<Android.Runtime.Register("getActiveNotifications", "()[Landroid/service/notification/StatusBarNotification;", "GetGetActiveNotificationsHandler", ApiSince=23)>]
abstract member GetActiveNotifications : unit -> Android.Service.Notification.StatusBarNotification[]
override this.GetActiveNotifications : unit -> Android.Service.Notification.StatusBarNotification[]

Returns

An array of StatusBarNotification.

Attributes

Remarks

Recover a list of active notifications: ones that have been posted by the calling app that have not yet been dismissed by the user or #cancel(String, int)ed by the app.

<Each notification is embedded in a StatusBarNotification object, including the original tag and id supplied to #notify(String, int, Notification) notify() (via StatusBarNotification#getTag() getTag() and StatusBarNotification#getId() getId()) as well as a copy of the original Notification object (via StatusBarNotification#getNotification()).

From Build.VERSION_CODES#Q, will also return notifications you've posted as an app's notification delegate via NotificationManager#notifyAsPackage(String, String, int, Notification).

Java documentation for android.app.NotificationManager.getActiveNotifications().

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