Android APIs
public static abstract class

MediaSession.Callback

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

Class Overview

Receives generic commands or updates from controllers and the system. Callbacks may be registered using addCallback(MediaSession.Callback).

Summary

Public Constructors
MediaSession.Callback()
Public Methods
void onControlCommand(String command, Bundle extras, ResultReceiver cb)
Called when a controller has sent a custom command to this session.
void onMediaButtonEvent(Intent mediaButtonIntent)
Called when a media button is pressed and this session has the highest priority or a controller sends a media button event to the session.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MediaSession.Callback ()

Public Methods

public void onControlCommand (String command, Bundle extras, ResultReceiver cb)

Called when a controller has sent a custom command to this session. The owner of the session may handle custom commands but is not required to.

Parameters
extras optional

public void onMediaButtonEvent (Intent mediaButtonIntent)

Called when a media button is pressed and this session has the highest priority or a controller sends a media button event to the session. TODO determine if using Intents identical to the ones RemoteControlClient receives is useful

The intent will be of type ACTION_MEDIA_BUTTON with a KeyEvent in EXTRA_KEY_EVENT

Parameters
mediaButtonIntent an intent containing the KeyEvent as an extra