MediaNotification

open class MediaNotification
kotlin.Any
   ↳ androidx.media.MediaSessionService2.MediaNotification

Returned by #onUpdateNotification() for making session service foreground service to keep playback running in the background. It's highly recommended to show media style notification here.

Summary

Public constructors
<init>(notificationId: Int, notification: Notification)

Default constructor

Public methods
open Int

Gets the id of the id.

open Notification

Gets the notification.

Public constructors

<init>

MediaNotification(notificationId: Int, notification: Notification)

Default constructor

Parameters
notificationId Int: notification id to be used for NotificationManager#notify(int, Notification).
notification Int: a notification to make session service foreground service. Media style notification is recommended here.

Public methods

getNotificationId

open fun getNotificationId(): Int

Gets the id of the id.

Return
Int: the notification id

getNotification

open fun getNotification(): Notification

Gets the notification.

Return
Notification: the notification