# MediaBrowserCompat.SubscriptionCallback

added in[version 24.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/MediaBrowserCompat.SubscriptionCallback#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v4-media/MediaBrowserCompat.SubscriptionCallback#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4-media/MediaBrowserCompat.SubscriptionCallback#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4-media/MediaBrowserCompat.SubscriptionCallback#)  

# MediaBrowserCompat.SubscriptionCallback

| 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
MediaBrowserCompat.SubscriptionCallback
`  
`

extends Object


``


`

|---|------------------------------------------------------------------|
| java.lang.Object                                                    ||
| ↳ | android.support.v4.media.MediaBrowserCompat.SubscriptionCallback |

<br />

*** ** * ** ***

Callbacks for subscription related events.

## Summary

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

|                                                                                                                                                                                                                                                                                  ### Public methods                                                                                                                                                                                                                                                                                  ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[onChildrenLoaded](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#onChildrenLoaded(java.lang.String, java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>))`(String parentId, List<`[MediaBrowserCompat.MediaItem](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.MediaItem)`> children) ` Called when the list of children is loaded or updated.                                                                                                        |
| ` void` | ` `[onChildrenLoaded](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#onChildrenLoaded(java.lang.String, java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>, android.os.Bundle))`(String parentId, List<`[MediaBrowserCompat.MediaItem](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.MediaItem)`> children, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` options) ` Called when the list of children is loaded or updated. |
| ` void` | ` `[onError](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#onError(java.lang.String))`(String parentId) ` Called when the id doesn't exist or other errors in subscribing.                                                                                                                                                                                                                                                                                                                                       |
| ` void` | ` `[onError](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#onError(java.lang.String, android.os.Bundle))`(String parentId, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` options) ` Called when the id doesn't exist or other errors in subscribing.                                                                                                                                                                                                                                |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4-media/MediaBrowserCompat.SubscriptionCallback#)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() `                    | ||

## Public constructors

### MediaBrowserCompat.SubscriptionCallback

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

```
MediaBrowserCompat.SubscriptionCallback ()
```

<br />

<br />

## Public methods

### onChildrenLoaded

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

```
void onChildrenLoaded (String parentId,
                List<MediaBrowserCompat.MediaItem> children)
```

Called when the list of children is loaded or updated.

<br />

|                             Parameters                              ||
|------------|---------------------------------------------------------|
| `parentId` | `String`: The media id of the parent media item. <br /> |
| `children` | `List`: The children which were loaded. <br />          |

### onChildrenLoaded

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

```
void onChildrenLoaded (String parentId,
                List<MediaBrowserCompat.MediaItem> children,
                Bundle options)
```

Called when the list of children is loaded or updated.

<br />

|                                                                                       Parameters                                                                                        ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `parentId` | `String`: The media id of the parent media item. <br />                                                                                                                     |
| `children` | `List`: The children which were loaded. <br />                                                                                                                              |
| `options`  | `Bundle`: A bundle of service-specific arguments to send to the media browse service. The contents of this bundle may affect the information returned when browsing. <br /> |

### onError

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

```
void onError (String parentId)
```

Called when the id doesn't exist or other errors in subscribing.

If this is called, the subscription remains until[unsubscribe(String)](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat#unsubscribe(java.lang.String))called, because some errors may heal themselves.

<br />

<br />

|                                               Parameters                                               ||
|------------|--------------------------------------------------------------------------------------------|
| `parentId` | `String`: The media id of the parent media item whose children could not be loaded. <br /> |

### onError

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

```
void onError (String parentId,
                Bundle options)
```

Called when the id doesn't exist or other errors in subscribing.

If this is called, the subscription remains until[unsubscribe(String)](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat#unsubscribe(java.lang.String))called, because some errors may heal themselves.

<br />

<br />

|                                               Parameters                                               ||
|------------|--------------------------------------------------------------------------------------------|
| `parentId` | `String`: The media id of the parent media item whose children could not be loaded. <br /> |
| `options`  | `Bundle`: A bundle of service-specific arguments sent to the media browse service. <br />  |

-

  ## Classes

  - [AudioAttributesCompat](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat)
  - [AudioAttributesCompat.Builder](https://developer.android.com/reference/android/support/v4/media/AudioAttributesCompat.Builder)
  - [MediaBrowserCompat](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat)
  - [MediaBrowserCompat.ConnectionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.ConnectionCallback)
  - [MediaBrowserCompat.CustomActionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.CustomActionCallback)
  - [MediaBrowserCompat.ItemCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.ItemCallback)
  - [MediaBrowserCompat.MediaItem](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.MediaItem)
  - [MediaBrowserCompat.SearchCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SearchCallback)
  - [MediaBrowserCompat.SubscriptionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback)
  - [MediaBrowserServiceCompat](https://developer.android.com/reference/android/support/v4/media/MediaBrowserServiceCompat)
  - [MediaBrowserServiceCompat.BrowserRoot](https://developer.android.com/reference/android/support/v4/media/MediaBrowserServiceCompat.BrowserRoot)
  - [MediaBrowserServiceCompat.Result](https://developer.android.com/reference/android/support/v4/media/MediaBrowserServiceCompat.Result)
  - [MediaDescriptionCompat](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat)
  - [MediaDescriptionCompat.Builder](https://developer.android.com/reference/android/support/v4/media/MediaDescriptionCompat.Builder)
  - [MediaMetadataCompat](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat)
  - [MediaMetadataCompat.Builder](https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat.Builder)
  - [RatingCompat](https://developer.android.com/reference/android/support/v4/media/RatingCompat)
  - [VolumeProviderCompat](https://developer.android.com/reference/android/support/v4/media/VolumeProviderCompat)
  - [VolumeProviderCompat.Callback](https://developer.android.com/reference/android/support/v4/media/VolumeProviderCompat.Callback)