# RemotePlaybackClient.ActionCallback

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/mediarouter/media/RemotePlaybackClient.ActionCallback "View this page in Java")

<br />

```
abstract class RemotePlaybackClient.ActionCallback
```

<br />

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

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

*** ** * ** ***

Base callback type for remote playback requests.

## Summary

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

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onError](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/RemotePlaybackClient.ActionCallback#onError(java.lang.String,int,android.os.Bundle))`(error: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?, code: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, data: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`?)` Called when a media control request fails. |

## Public constructors

### ActionCallback

Added in 1.1.0  

```
ActionCallback()
```  

## Public functions

### onError

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

```
fun onError(error: String?, code: Int, data: Bundle?): Unit
```

Called when a media control request fails.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `error: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?` | A localized error message which may be shown to the user, or null if the cause of the error is unclear.                                                    |
| `code: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)           | The error code, or[ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaControlIntent#ERROR_UNKNOWN())if unknown. |
| `data: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`?`           | The error data bundle, or null if none.                                                                                                                    |