public class

MediaSessionService.MediaNotification

extends java.lang.Object

 java.lang.Object

↳androidx.media2.MediaSessionService.MediaNotification

Overview

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

Constructors
publicMediaNotification(int notificationId, Notification notification)

Default constructor

Methods
public NotificationgetNotification()

Gets the notification.

public intgetNotificationId()

Gets the id of the id.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public MediaNotification(int notificationId, Notification notification)

Default constructor

Parameters:

notificationId: notification id to be used for .
notification: a notification to make session service foreground service. Media style notification is recommended here.

Methods

public int getNotificationId()

Gets the id of the id.

Returns:

the notification id

public Notification getNotification()

Gets the notification.

Returns:

the notification