MediaNotification
open class MediaNotification
kotlin.Any | |
↳ | androidx.media2.session.MediaSessionService.MediaNotification |
Returned by onUpdateNotification(MediaSession)
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, @NonNull notification: Notification) Default constructor |
Public methods | |
---|---|
open Notification |
Gets the notification. |
open Int |
Gets the id of the id. |
Public constructors
<init>
MediaNotification(
notificationId: Int,
@NonNull notification: Notification)
Default constructor
Parameters | |
---|---|
notificationId |
Int: notification id to be used for NotificationManager#notify(int, Notification) . |
notification |
Notification: a notification to make session service foreground service. Media style notification is recommended here. |
Public methods
getNotification
@NonNull open fun getNotification(): Notification
Gets the notification.
Return | |
---|---|
Notification |
the notification |