# MediaBrowser.SubscriptionCallback

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/media/browse/MediaBrowser.SubscriptionCallback#pubctors)\|[Methods](https://developer.android.com/reference/android/media/browse/MediaBrowser.SubscriptionCallback#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/media/browse/MediaBrowser.SubscriptionCallback#inhmethods)  

# MediaBrowser.SubscriptionCallback

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/media/browse/MediaBrowser.SubscriptionCallback "View this page in Kotlin")\|Java

`
public
static

abstract
class
MediaBrowser.SubscriptionCallback
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.browse.MediaBrowser.SubscriptionCallback |

<br />

*** ** * ** ***

Callbacks for subscription related events.

## Summary

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

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

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### SubscriptionCallback

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public SubscriptionCallback ()
```

<br />

<br />

## Public methods

### onChildrenLoaded

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

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

Called when the list of children is loaded or updated.

<br />

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

### onChildrenLoaded

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onChildrenLoaded (String parentId, 
                List<MediaBrowser.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. This value cannot be`null`. <br />                                                                                                                     |
| `children` | `List`: The children which were loaded. This value cannot be`null`. <br />                                                                                                                              |
| `options`  | `Bundle`: The bundle of service-specific arguments sent to the media browser service. The contents of this bundle may affect the information returned when browsing. This value cannot be`null`. <br /> |

### onError

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

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

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

If this is called, the subscription remains until[MediaBrowser.unsubscribe](https://developer.android.com/reference/android/media/browse/MediaBrowser#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. This value cannot be`null`. <br /> |

### onError

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public 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[MediaBrowser.unsubscribe](https://developer.android.com/reference/android/media/browse/MediaBrowser#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. This value cannot be`null`. <br />   |
| `options`  | `Bundle`: The bundle of service-specific arguments sent to the media browser service. This value cannot be`null`. <br /> |