# RemotePlaybackClient.ActionCallback

Artifact: [androidx.mediarouter:mediarouter](https://developer.android.com/jetpack/androidx/releases/mediarouter) [View Source](https://cs.android.com/search?q=file:androidx/mediarouter/media/RemotePlaybackClient.java+class:androidx.mediarouter.media.RemotePlaybackClient.ActionCallback) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/mediarouter#1.1.0)

*** ** * ** ***


```
public abstract class RemotePlaybackClient.ActionCallback
```

<br />

Known direct subclasses [RemotePlaybackClient.ItemActionCallback](https://developer.android.com/reference/androidx/mediarouter/media/RemotePlaybackClient.ItemActionCallback), [RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/androidx/mediarouter/media/RemotePlaybackClient.SessionActionCallback)

|---|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/RemotePlaybackClient.ItemActionCallback` | Callback for remote playback requests that operate on items. |
| `https://developer.android.com/reference/androidx/mediarouter/media/RemotePlaybackClient.SessionActionCallback` | Callback for remote playback requests that operate on sessions. |

*** ** * ** ***

Base callback type for remote playback requests.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/mediarouter/media/RemotePlaybackClient.ActionCallback#ActionCallback()()` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/mediarouter/media/RemotePlaybackClient.ActionCallback#onError(java.lang.String,int,android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html error, int code, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html data)` Called when a media control request fails. |

## Public constructors

### ActionCallback

Added in 1.1.0

```
public ActionCallback()
```

## Public methods

### onError

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

```
public void onError(@Nullable String error, int code, @Nullable Bundle data)
```

Called when a media control request fails.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html error` | A localized error message which may be shown to the user, or null if the cause of the error is unclear. |
| `int code` | The error code, or `https://developer.android.com/reference/androidx/mediarouter/media/MediaControlIntent#ERROR_UNKNOWN()` if unknown. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html data` | The error data bundle, or null if none. |