MediaSessionService.MediaNotification
public
static
class
MediaSessionService.MediaNotification
extends Object
| java.lang.Object | |
| ↳ | androidx.media2.session.MediaSessionService.MediaNotification |
Returned by MediaSessionService.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 | |
|---|---|
MediaSessionService.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
MediaSessionService.MediaNotification
public MediaSessionService.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
public Notification getNotification ()
Gets the notification.
| Returns | |
|---|---|
Notification |
the notification |
getNotificationId
public int getNotificationId ()
Gets the id of the id.
| Returns | |
|---|---|
int |
the notification id |