# MediaControllerCompat.Callback

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-media-compat:28.0.0-alpha1  
Summary:[Ctors](https://developer.android.com/reference/android/support/v4-media-session/MediaControllerCompat.Callback#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v4-media-session/MediaControllerCompat.Callback#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4-media-session/MediaControllerCompat.Callback#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4-media-session/MediaControllerCompat.Callback#)  

# MediaControllerCompat.Callback

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static

abstract
class
MediaControllerCompat.Callback
`  
`

extends Object


``


implements

`[IBinder.DeathRecipient](https://developer.android.com/reference/android/os/IBinder.DeathRecipient.html)`


`

|---|-----------------------------------------------------------------|
| java.lang.Object                                                   ||
| ↳ | android.support.v4.media.session.MediaControllerCompat.Callback |

<br />

*** ** * ** ***

Callback for receiving updates on from the session. A Callback can be registered using[registerCallback(MediaControllerCompat.Callback)](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat#registerCallback(android.support.v4.media.session.MediaControllerCompat.Callback))

## Summary

|                                                                                ### Public constructors                                                                                ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[MediaControllerCompat.Callback](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#MediaControllerCompat.Callback())`() ` |

|                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                               ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[binderDied](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#binderDied())`() `                                                                                                                                                                                                                                                                                           |
| ` void` | ` `[onAudioInfoChanged](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onAudioInfoChanged(android.support.v4.media.session.MediaControllerCompat.PlaybackInfo))`(`[MediaControllerCompat.PlaybackInfo](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo)` info) ` Override to handle changes to the audio info.  |
| ` void` | ` `[onCaptioningEnabledChanged](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onCaptioningEnabledChanged(boolean))`(boolean enabled) ` Override to handle changes to the captioning enabled status.                                                                                                                                                                        |
| ` void` | ` `[onExtrasChanged](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onExtrasChanged(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras) ` Override to handle changes to the[MediaSessionCompat](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat)extras.                     |
| ` void` | ` `[onMetadataChanged](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onMetadataChanged(android.support.v4.media.MediaMetadataCompat))`(`[MediaMetadataCompat](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat)` metadata) ` Override to handle changes to the current metadata.                                                       |
| ` void` | ` `[onPlaybackStateChanged](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onPlaybackStateChanged(android.support.v4.media.session.PlaybackStateCompat))`(`[PlaybackStateCompat](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat)` state) ` Override to handle changes in playback state.                                      |
| ` void` | ` `[onQueueChanged](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onQueueChanged(java.util.List<android.support.v4.media.session.MediaSessionCompat.QueueItem>))`(List<`[MediaSessionCompat.QueueItem](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.QueueItem)`> queue) ` Override to handle changes to items in the queue. |
| ` void` | ` `[onQueueTitleChanged](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onQueueTitleChanged(java.lang.CharSequence))`(CharSequence title) ` Override to handle changes to the queue title.                                                                                                                                                                                  |
| ` void` | ` `[onRepeatModeChanged](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onRepeatModeChanged(int))`(int repeatMode) ` Override to handle changes to the repeat mode.                                                                                                                                                                                                         |
| ` void` | ` `[onSessionDestroyed](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onSessionDestroyed())`() ` Override to handle the session being destroyed.                                                                                                                                                                                                                           |
| ` void` | ` `[onSessionEvent](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onSessionEvent(java.lang.String, android.os.Bundle))`(String event, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras) ` Override to handle custom events sent by the session owner without a specified interface.                                                       |
| ` void` | ` `[onSessionReady](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onSessionReady())`() ` Override to handle the session being ready.                                                                                                                                                                                                                                       |
| ` void` | ` `[onShuffleModeChanged](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback#onShuffleModeChanged(int))`(int shuffleMode) ` Override to handle changes to the shuffle mode.                                                                                                                                                                                                     |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4-media-session/MediaControllerCompat.Callback#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4-media-session/MediaControllerCompat.Callback#)From interface` `[android.os.IBinder.DeathRecipient](https://developer.android.com/reference/android/os/IBinder.DeathRecipient.html)` ` |------------------|------------------| | ` abstract void` | ` binderDied() ` | ||

## Public constructors

### MediaControllerCompat.Callback

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
MediaControllerCompat.Callback ()
```

<br />

<br />

## Public methods

### binderDied

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void binderDied ()
```

<br />

<br />

### onAudioInfoChanged

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onAudioInfoChanged (MediaControllerCompat.PlaybackInfo info)
```

Override to handle changes to the audio info.

<br />

|                                          Parameters                                           ||
|--------|---------------------------------------------------------------------------------------|
| `info` | `MediaControllerCompat.PlaybackInfo`: The current audio info for this session. <br /> |

### onCaptioningEnabledChanged

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onCaptioningEnabledChanged (boolean enabled)
```

Override to handle changes to the captioning enabled status.

<br />

|                                  Parameters                                  ||
|-----------|-------------------------------------------------------------------|
| `enabled` | `boolean`:`true`if captioning is enabled,`false`otherwise. <br /> |

### onExtrasChanged

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onExtrasChanged (Bundle extras)
```

Override to handle changes to the[MediaSessionCompat](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat)extras.

<br />

|                                                                                                   Parameters                                                                                                   ||
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `extras` | `Bundle`: The extras that can include other information associated with the[MediaSessionCompat](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat). <br /> |

### onMetadataChanged

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onMetadataChanged (MediaMetadataCompat metadata)
```

Override to handle changes to the current metadata.

<br />

|                                           Parameters                                            ||
|------------|-------------------------------------------------------------------------------------|
| `metadata` | `MediaMetadataCompat`: The current metadata for the session or null if none. <br /> |

**See also:**

- [MediaMetadataCompat](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat)  

### onPlaybackStateChanged

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onPlaybackStateChanged (PlaybackStateCompat state)
```

Override to handle changes in playback state.

<br />

|                                  Parameters                                  ||
|---------|---------------------------------------------------------------------|
| `state` | `PlaybackStateCompat`: The new playback state of the session <br /> |

### onQueueChanged

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onQueueChanged (List<MediaSessionCompat.QueueItem> queue)
```

Override to handle changes to items in the queue.

<br />

|                                                                              Parameters                                                                               ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `queue` | `List`: 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. <br /> |

**See also:**

- [MediaSessionCompat.QueueItem](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.QueueItem)  

### onQueueTitleChanged

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onQueueTitleChanged (CharSequence title)
```

Override to handle changes to the queue title.

<br />

|                                                                         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. <br /> |

### onRepeatModeChanged

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onRepeatModeChanged (int repeatMode)
```

Override to handle changes to the repeat mode.

<br />

|                                                                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                                                                     ||
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `repeatMode` | `int`: The repeat mode. It should be one of followings:[REPEAT_MODE_NONE](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat#REPEAT_MODE_NONE),[REPEAT_MODE_ONE](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat#REPEAT_MODE_ONE),[REPEAT_MODE_ALL](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat#REPEAT_MODE_ALL),[REPEAT_MODE_GROUP](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat#REPEAT_MODE_GROUP) <br /> |

### onSessionDestroyed

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onSessionDestroyed ()
```

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

<br />

### onSessionEvent

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onSessionEvent (String event,
                Bundle extras)
```

Override to handle custom events sent by the session owner without a specified interface. Controllers should only handle these for sessions they own.

<br />

|                          Parameters                           ||
|----------|-----------------------------------------------------|
| `event`  | `String`: The event from the session. <br />        |
| `extras` | `Bundle`: Optional parameters for the event. <br /> |

### onSessionReady

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onSessionReady ()
```

Override to handle the session being ready.

<br />

**See also:**

- [isSessionReady()](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat#isSessionReady())  

### onShuffleModeChanged

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onShuffleModeChanged (int shuffleMode)
```

Override to handle changes to the shuffle mode.

<br />

|                                                                                                                                                                                                                                        Parameters                                                                                                                                                                                                                                        ||
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `shuffleMode` | `int`: The shuffle mode. Must be one of the followings:[SHUFFLE_MODE_NONE](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat#SHUFFLE_MODE_NONE),[SHUFFLE_MODE_ALL](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat#SHUFFLE_MODE_ALL),[SHUFFLE_MODE_GROUP](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat#SHUFFLE_MODE_GROUP) <br /> |

-

  ## Interfaces

  - [MediaSessionCompat.OnActiveChangeListener](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.OnActiveChangeListener)
-

  ## Classes

  - [MediaButtonReceiver](https://developer.android.com/reference/android/support/v4/media/session/MediaButtonReceiver)
  - [MediaControllerCompat](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat)
  - [MediaControllerCompat.Callback](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.Callback)
  - [MediaControllerCompat.PlaybackInfo](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.PlaybackInfo)
  - [MediaControllerCompat.TransportControls](https://developer.android.com/reference/android/support/v4/media/session/MediaControllerCompat.TransportControls)
  - [MediaSessionCompat](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat)
  - [MediaSessionCompat.Callback](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.Callback)
  - [MediaSessionCompat.QueueItem](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.QueueItem)
  - [MediaSessionCompat.Token](https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat.Token)
  - [ParcelableVolumeInfo](https://developer.android.com/reference/android/support/v4/media/session/ParcelableVolumeInfo)
  - [PlaybackStateCompat](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat)
  - [PlaybackStateCompat.Builder](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.Builder)
  - [PlaybackStateCompat.CustomAction](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction)
  - [PlaybackStateCompat.CustomAction.Builder](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder)