# MediaBrowserCompat.SubscriptionCallback

Artifact: [androidx.media:media](https://developer.android.com/jetpack/androidx/releases/media) [View Source](https://cs.android.com/search?q=file:android/support/v4/media/MediaBrowserCompat.java+class:android.support.v4.media.MediaBrowserCompat.SubscriptionCallback) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

*** ** * ** ***


```
public abstract class MediaBrowserCompat.SubscriptionCallback
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> androidx.media is deprecated. Please migrate to [androidx.media3](https://developer.android.com/media/media3).

Callbacks for subscription related events.

## Summary

| ### Public constructors |
|---|
| `[SubscriptionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#SubscriptionCallback())()` **This method is deprecated.** Deprecated in Java |

| ### 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>))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parentId, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.MediaItem> children )` **This method is deprecated.** Deprecated in Java |
| `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))( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parentId, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.MediaItem> children, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html options )` **This method is deprecated.** Deprecated in Java |
| `void` | `[onError](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#onError(java.lang.String))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parentId)` **This method is deprecated.** Deprecated in Java |
| `void` | `[onError](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#onError(java.lang.String,android.os.Bundle))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parentId, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html options)` **This method is deprecated.** Deprecated in Java |

## Public constructors

### SubscriptionCallback

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public [SubscriptionCallback](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#SubscriptionCallback())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

## Public methods

### onChildrenLoaded

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public 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>))(
    @NonNull String parentId,
    @NonNull List<MediaBrowserCompat.MediaItem> children
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called when the list of children is loaded or updated.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parentId` | The media id of the parent media item. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.MediaItem> children` | The children which were loaded. |

### onChildrenLoaded

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public 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))(
    @NonNull String parentId,
    @NonNull List<MediaBrowserCompat.MediaItem> children,
    @NonNull Bundle options
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Called when the list of children is loaded or updated.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parentId` | The media id of the parent media item. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.MediaItem> children` | The children which were loaded. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html options` | 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. |

### onError

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public void [onError](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#onError(java.lang.String))(@NonNull String parentId)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

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

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parentId` | The media id of the parent media item whose children could not be loaded. |

### onError

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/media#1.1.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/media#1.8.0)

```
public void [onError](https://developer.android.com/reference/android/support/v4/media/MediaBrowserCompat.SubscriptionCallback#onError(java.lang.String,android.os.Bundle))(@NonNull String parentId, @NonNull Bundle options)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

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

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html parentId` | The media id of the parent media item whose children could not be loaded. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html options` | A bundle of service-specific arguments sent to the media browse service. |