Share via


NotificationListenerService.OnNotificationRemoved Method

Definition

Overloads

OnNotificationRemoved(StatusBarNotification)

Implement this method to learn when notifications are removed.

OnNotificationRemoved(StatusBarNotification, NotificationListenerService+RankingMap)

Implement this method to learn when notifications are removed.

OnNotificationRemoved(StatusBarNotification, NotificationListenerService+RankingMap, NotificationCancelReason)

Implement this method to learn when notifications are removed.

OnNotificationRemoved(StatusBarNotification)

Implement this method to learn when notifications are removed.

[Android.Runtime.Register("onNotificationRemoved", "(Landroid/service/notification/StatusBarNotification;)V", "GetOnNotificationRemoved_Landroid_service_notification_StatusBarNotification_Handler")]
public virtual void OnNotificationRemoved (Android.Service.Notification.StatusBarNotification? sbn);
[<Android.Runtime.Register("onNotificationRemoved", "(Landroid/service/notification/StatusBarNotification;)V", "GetOnNotificationRemoved_Landroid_service_notification_StatusBarNotification_Handler")>]
abstract member OnNotificationRemoved : Android.Service.Notification.StatusBarNotification -> unit
override this.OnNotificationRemoved : Android.Service.Notification.StatusBarNotification -> unit

Parameters

sbn
StatusBarNotification

A data structure encapsulating at least the original information (tag and id) and source (package name) used to post the android.app.Notification that was just removed.

Attributes

Remarks

Implement this method to learn when notifications are removed.

This might occur because the user has dismissed the notification using system UI (or another notification listener) or because the app has withdrawn the notification.

NOTE: The StatusBarNotification object you receive will be "light"; that is, the result from StatusBarNotification#getNotification may be missing some heavyweight fields such as android.app.Notification#contentView and android.app.Notification#largeIcon. However, all other fields on StatusBarNotification, sufficient to match this call with a prior call to #onNotificationPosted(StatusBarNotification), will be intact.

Java documentation for android.service.notification.NotificationListenerService.onNotificationRemoved(android.service.notification.StatusBarNotification).

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

OnNotificationRemoved(StatusBarNotification, NotificationListenerService+RankingMap)

Implement this method to learn when notifications are removed.

[Android.Runtime.Register("onNotificationRemoved", "(Landroid/service/notification/StatusBarNotification;Landroid/service/notification/NotificationListenerService$RankingMap;)V", "GetOnNotificationRemoved_Landroid_service_notification_StatusBarNotification_Landroid_service_notification_NotificationListenerService_RankingMap_Handler")]
public virtual void OnNotificationRemoved (Android.Service.Notification.StatusBarNotification? sbn, Android.Service.Notification.NotificationListenerService.RankingMap? rankingMap);
[<Android.Runtime.Register("onNotificationRemoved", "(Landroid/service/notification/StatusBarNotification;Landroid/service/notification/NotificationListenerService$RankingMap;)V", "GetOnNotificationRemoved_Landroid_service_notification_StatusBarNotification_Landroid_service_notification_NotificationListenerService_RankingMap_Handler")>]
abstract member OnNotificationRemoved : Android.Service.Notification.StatusBarNotification * Android.Service.Notification.NotificationListenerService.RankingMap -> unit
override this.OnNotificationRemoved : Android.Service.Notification.StatusBarNotification * Android.Service.Notification.NotificationListenerService.RankingMap -> unit

Parameters

sbn
StatusBarNotification

A data structure encapsulating at least the original information (tag and id) and source (package name) used to post the android.app.Notification that was just removed.

rankingMap
NotificationListenerService.RankingMap

The current ranking map that can be used to retrieve ranking information for active notifications.

Attributes

Remarks

Java documentation for android.service.notification.NotificationListenerService.onNotificationRemoved(android.service.notification.StatusBarNotification).

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

OnNotificationRemoved(StatusBarNotification, NotificationListenerService+RankingMap, NotificationCancelReason)

Implement this method to learn when notifications are removed.

[Android.Runtime.Register("onNotificationRemoved", "(Landroid/service/notification/StatusBarNotification;Landroid/service/notification/NotificationListenerService$RankingMap;I)V", "GetOnNotificationRemoved_Landroid_service_notification_StatusBarNotification_Landroid_service_notification_NotificationListenerService_RankingMap_IHandler", ApiSince=26)]
public virtual void OnNotificationRemoved (Android.Service.Notification.StatusBarNotification? sbn, Android.Service.Notification.NotificationListenerService.RankingMap? rankingMap, Android.Service.Notification.NotificationCancelReason reason);
[<Android.Runtime.Register("onNotificationRemoved", "(Landroid/service/notification/StatusBarNotification;Landroid/service/notification/NotificationListenerService$RankingMap;I)V", "GetOnNotificationRemoved_Landroid_service_notification_StatusBarNotification_Landroid_service_notification_NotificationListenerService_RankingMap_IHandler", ApiSince=26)>]
abstract member OnNotificationRemoved : Android.Service.Notification.StatusBarNotification * Android.Service.Notification.NotificationListenerService.RankingMap * Android.Service.Notification.NotificationCancelReason -> unit
override this.OnNotificationRemoved : Android.Service.Notification.StatusBarNotification * Android.Service.Notification.NotificationListenerService.RankingMap * Android.Service.Notification.NotificationCancelReason -> unit

Parameters

sbn
StatusBarNotification

A data structure encapsulating at least the original information (tag and id) and source (package name) used to post the android.app.Notification that was just removed.

Attributes

Remarks

Java documentation for android.service.notification.NotificationListenerService.onNotificationRemoved(android.service.notification.StatusBarNotification).

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