PlayerNotificationManager.NotificationListener


interface PlayerNotificationManager.NotificationListener


A listener for changes to the notification.

Summary

Public functions

Unit
onNotificationCancelled(notificationId: Int, dismissedByUser: Boolean)

Called after the notification has been cancelled.

Unit
onNotificationPosted(
    notificationId: Int,
    notification: Notification!,
    ongoing: Boolean
)

Called each time after the notification has been posted.

Public functions

onNotificationCancelled

fun onNotificationCancelled(notificationId: Int, dismissedByUser: Boolean): Unit

Called after the notification has been cancelled.

Parameters
notificationId: Int

The id of the notification which has been cancelled.

dismissedByUser: Boolean

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

onNotificationPosted

fun onNotificationPosted(
    notificationId: Int,
    notification: Notification!,
    ongoing: Boolean
): Unit

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
notificationId: Int

The id of the notification which has been posted.

notification: Notification!

The Notification.

ongoing: Boolean

Whether the notification is ongoing.