Share via


NotificationListenerService.GetActiveNotifications Method

Definition

Overloads

GetActiveNotifications()

Request the list of outstanding notifications (that is, those that are visible to the current user).

GetActiveNotifications(String[])

Request one or more notifications by key.

GetActiveNotifications()

Request the list of outstanding notifications (that is, those that are visible to the current user).

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

Returns

An array of active notifications, sorted in natural order.

Attributes

Remarks

Request the list of outstanding notifications (that is, those that are visible to the current user). Useful when you don't know what's already been posted.

The service should wait for the #onListenerConnected() event before performing this operation.

Java documentation for android.service.notification.NotificationListenerService.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

GetActiveNotifications(String[])

Request one or more notifications by key.

[Android.Runtime.Register("getActiveNotifications", "([Ljava/lang/String;)[Landroid/service/notification/StatusBarNotification;", "GetGetActiveNotifications_arrayLjava_lang_String_Handler")]
public virtual Android.Service.Notification.StatusBarNotification[]? GetActiveNotifications (string[]? keys);
[<Android.Runtime.Register("getActiveNotifications", "([Ljava/lang/String;)[Landroid/service/notification/StatusBarNotification;", "GetGetActiveNotifications_arrayLjava_lang_String_Handler")>]
abstract member GetActiveNotifications : string[] -> Android.Service.Notification.StatusBarNotification[]
override this.GetActiveNotifications : string[] -> Android.Service.Notification.StatusBarNotification[]

Parameters

keys
String[]

the keys of the notifications to request

Returns

An array of notifications corresponding to the requested keys, in the same order as the key list.

Attributes

Remarks

Request one or more notifications by key. Useful if you have been keeping track of notifications but didn't want to retain the bits, and now need to go back and extract more data out of those notifications.

The service should wait for the #onListenerConnected() event before performing this operation.

Java documentation for android.service.notification.NotificationListenerService.getActiveNotifications(java.lang.String[]).

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