PlayerNotificationManager.NotificationListener


public interface PlayerNotificationManager.NotificationListener


A listener for changes to the notification.

Summary

Public methods

default void
onNotificationCancelled(int notificationId, boolean dismissedByUser)

Called after the notification has been cancelled.

default void
onNotificationPosted(
    int notificationId,
    Notification notification,
    boolean ongoing
)

Called each time after the notification has been posted.

Public methods

onNotificationCancelled

default void onNotificationCancelled(int notificationId, boolean dismissedByUser)

Called after the notification has been cancelled.

Parameters
int notificationId

The id of the notification which has been cancelled.

boolean dismissedByUser

true if the notification is cancelled because the user dismissed the notification.

onNotificationPosted

default void onNotificationPosted(
    int notificationId,
    Notification notification,
    boolean ongoing
)

Called each time after the notification has been posted.

For a service, the ongoing flag can be used as an indicator as to whether it should be in the foreground.

Parameters
int notificationId

The id of the notification which has been posted.

Notification notification

The Notification.

boolean ongoing

Whether the notification is ongoing.