Android APIs
public static abstract class

MediaController.Callback

extends Object
java.lang.Object
   ↳ android.media.session.MediaController.Callback

Class Overview

Callback for receiving updates on from the session. A Callback can be registered using registerCallback(MediaController.Callback)

Summary

Public Constructors
MediaController.Callback()
Public Methods
void onAudioInfoChanged(MediaController.PlaybackInfo info)
Override to handle changes to the audio info.
void onExtrasChanged(Bundle extras)
Override to handle changes to the MediaSession extras.
void onMetadataChanged(MediaMetadata metadata)
Override to handle changes to the current metadata.
void onPlaybackStateChanged(PlaybackState state)
Override to handle changes in playback state.
void onQueueChanged(List<MediaSession.QueueItem> queue)
Override to handle changes to items in the queue.
void onQueueTitleChanged(CharSequence title)
Override to handle changes to the queue title.
void onSessionDestroyed()
Override to handle the session being destroyed.
void onSessionEvent(String event, Bundle extras)
Override to handle custom events sent by the session owner without a specified interface.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MediaController.Callback ()

Added in API level 21

Public Methods

public void onAudioInfoChanged (MediaController.PlaybackInfo info)

Added in API level 21

Override to handle changes to the audio info.

Parameters
info The current audio info for this session.

public void onExtrasChanged (Bundle extras)

Added in API level 21

Override to handle changes to the MediaSession extras.

Parameters
extras The extras that can include other information associated with the MediaSession.

public void onMetadataChanged (MediaMetadata metadata)

Added in API level 21

Override to handle changes to the current metadata.

Parameters
metadata The current metadata for the session or null if none.
See Also

public void onPlaybackStateChanged (PlaybackState state)

Added in API level 21

Override to handle changes in playback state.

Parameters
state The new playback state of the session

public void onQueueChanged (List<MediaSession.QueueItem> queue)

Added in API level 21

Override to handle changes to items in the queue.

Parameters
queue 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.

public void onQueueTitleChanged (CharSequence title)

Added in API level 21

Override to handle changes to the queue title.

Parameters
title The title that should be displayed along with the play queue such as "Now Playing". May be null if there is no such title.

public void onSessionDestroyed ()

Added in API level 21

Override to handle the session being destroyed. The session is no longer valid after this call and calls to it will be ignored.

public void onSessionEvent (String event, Bundle extras)

Added in API level 21

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 The event from the session.
extras Optional parameters for the event, may be null.