Callback
abstract class Callback
| kotlin.Any | |
| ↳ | android.media.session.MediaController.Callback |
Callback for receiving updates from the session. A Callback can be registered using #registerCallback.
Summary
| Public constructors | |
|---|---|
Callback() |
|
| Public methods | |
|---|---|
| open Unit |
onAudioInfoChanged(playbackInfo: MediaController.PlaybackInfo)Signals a change in the session's |
| open Unit |
onExtrasChanged(extras: Bundle?)Override to handle changes to the |
| open Unit |
onMetadataChanged(metadata: MediaMetadata?)Override to handle changes to the current metadata. |
| open Unit |
onPlaybackStateChanged(state: PlaybackState?)Override to handle changes in playback state. |
| open Unit |
onQueueChanged(queue: MutableList<MediaSession.QueueItem!>?)Override to handle changes to items in the queue. |
| open Unit |
onQueueTitleChanged(title: CharSequence?)Override to handle changes to the queue title. |
| open Unit |
Override to handle the session being destroyed. |
| open Unit |
onSessionEvent(event: String, extras: Bundle?)Override to handle custom events sent by the session owner without a specified interface. |
Public constructors
Callback
Callback()
Public methods
onAudioInfoChanged
open fun onAudioInfoChanged(playbackInfo: MediaController.PlaybackInfo): Unit
Signals a change in the session's PlaybackInfo.
| Parameters | |
|---|---|
playbackInfo |
MediaController.PlaybackInfo: The latest known state of the session's playback info. This value cannot be null. |
onExtrasChanged
open fun onExtrasChanged(extras: Bundle?): Unit
Override to handle changes to the MediaSession extras.
| Parameters | |
|---|---|
extras |
Bundle?: The extras that can include other information associated with the MediaSession. This value may be null. |
onMetadataChanged
open fun onMetadataChanged(metadata: MediaMetadata?): Unit
Override to handle changes to the current metadata.
| Parameters | |
|---|---|
metadata |
MediaMetadata?: The current metadata for the session or null if none. |
See Also
onPlaybackStateChanged
open fun onPlaybackStateChanged(state: PlaybackState?): Unit
Override to handle changes in playback state.
| Parameters | |
|---|---|
state |
PlaybackState?: The new playback state of the session This value may be null. |
onQueueChanged
open fun onQueueChanged(queue: MutableList<MediaSession.QueueItem!>?): Unit
Override to handle changes to items in the queue.
| Parameters | |
|---|---|
queue |
MutableList<MediaSession.QueueItem!>?: A list of items in the current play queue. It should include the currently playing item as well as previous and upcoming items if applicable. This value may be null. |
onQueueTitleChanged
open fun onQueueTitleChanged(title: CharSequence?): Unit
Override to handle changes to the queue title.
| Parameters | |
|---|---|
title |
CharSequence?: The title that should be displayed along with the play queue such as "Now Playing". May be null if there is no such title. |
onSessionDestroyed
open fun onSessionDestroyed(): Unit
Override to handle the session being destroyed. The session is no longer valid after this call and calls to it will be ignored.
onSessionEvent
open fun onSessionEvent(
event: String,
extras: Bundle?
): Unit
Override to handle custom events sent by the session owner without a specified interface. Controllers should only handle these for sessions they own.
| Parameters | |
|---|---|
event |
String: The event from the session. This value cannot be null. |
extras |
Bundle?: Optional parameters for the event, may be null. |