belongs to Maven artifact androidx.media:media:1.0.0-alpha1

MediaSessionService2.MediaNotification

public static class MediaSessionService2.MediaNotification
extends Object

java.lang.Object
   ↳ androidx.media.MediaSessionService2.MediaNotification


Returned by MediaSessionService2.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

MediaSessionService2.MediaNotification(int notificationId, Notification notification)

Default constructor

Public methods

Notification getNotification()

Gets the notification.

int getNotificationId()

Gets the id of the id.

Inherited methods

Public constructors

MediaSessionService2.MediaNotification

MediaSessionService2.MediaNotification (int notificationId, 
                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

Notification getNotification ()

Gets the notification.

Returns
Notification the notification

getNotificationId

int getNotificationId ()

Gets the id of the id.

Returns
int the notification id