MediaNotification


public final class MediaNotification


A notification for media playbacks.

Summary

Nested types

Creates actions and pending intents for notifications.

Provides media notifications to be posted as notifications that reflect the state of a MediaController and to send media commands to a .

Receives updates for a notification.

Public fields

final Notification

The Notification.

final @IntRange(from = 1) int

The notification id.

Public constructors

MediaNotification(
    @IntRange(from = 1) int notificationId,
    Notification notification
)

Creates an instance.

Public fields

notification

public final Notification notification

The Notification.

notificationId

public final @IntRange(from = 1) int notificationId

The notification id.

Public constructors

MediaNotification

public MediaNotification(
    @IntRange(from = 1) int notificationId,
    Notification notification
)

Creates an instance.

Parameters
@IntRange(from = 1) int notificationId

The notification id to be used for notify.

Notification notification

A Notification that reflects the state of a MediaController and to send media commands to a MediaSession. The notification may be used to start a service in the foreground. It's highly recommended to use a media style notification.