NotificationListenerService.GetActiveNotifications 方法

定义

重载

GetActiveNotifications()

请求未完成通知的列表(即当前用户可见的通知)。

GetActiveNotifications(String[])

按密钥请求一个或多个通知。

GetActiveNotifications()

请求未完成通知的列表(即当前用户可见的通知)。

[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[]

返回

活动通知数组,按自然顺序排序。

属性

注解

请求未完成通知的列表(即当前用户可见的通知)。 当你不知道已发布的内容时非常有用。

服务应在执行此操作之前等待 #onListenerConnected() 事件。

适用于 . 的 android.service.notification.NotificationListenerService.getActiveNotifications()Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

GetActiveNotifications(String[])

按密钥请求一个或多个通知。

[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[]

参数

keys
String[]

要请求的通知的密钥

返回

与请求的密钥对应的通知数组,其顺序与密钥列表相同。

属性

注解

按密钥请求一个或多个通知。 如果你一直在跟踪通知,但不想保留位,现在需要返回并从这些通知中提取更多数据,则很有用。

服务应在执行此操作之前等待 #onListenerConnected() 事件。

适用于 . 的 android.service.notification.NotificationListenerService.getActiveNotifications(java.lang.String[])Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于