# PlaybackStateCompat.CustomAction.Builder

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/session/PlaybackStateCompat.java+class:android.support.v4.media.session.PlaybackStateCompat.CustomAction.Builder) 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)

*** ** * ** ***


```
class PlaybackStateCompat.CustomAction.Builder
```

<br />

*** ** * ** ***

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

Builder for `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction` objects.

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder#Builder(java.lang.String,java.lang.CharSequence,int))(action: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!, icon: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction!` | `[build](https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder#build())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder!` | `[setExtras](https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder#setExtras(android.os.Bundle))(extras: https://developer.android.com/reference/android/os/Bundle.html!)` **This function is deprecated.** Deprecated in Java |

## Public constructors

### Builder

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)

```
[Builder](https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder#Builder(java.lang.String,java.lang.CharSequence,int))(action: String!, name: CharSequence!, icon: Int)
```

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

Creates a `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction` builder with the id, name, and icon set.

| Parameters |
|---|---|
| `action: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The action of the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. |
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` | The display name of the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. This name will be displayed along side the action if the UI supports it. |
| `icon: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The icon resource id of the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. This resource id must be in the same package as the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaSessionCompat`. It will be displayed with the custom action if the UI supports it. |

## Public functions

### build

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)

```
fun [build](https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder#build())(): PlaybackStateCompat.CustomAction!
```

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

Build and return the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction` instance with the specified values.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction!` | A new `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction` instance. |

### setExtras

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)

```
fun [setExtras](https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder#setExtras(android.os.Bundle))(extras: Bundle!): PlaybackStateCompat.CustomAction.Builder!
```

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

Set optional extras for the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. These extras are meant to be consumed by a `https://developer.android.com/reference/kotlin/android/support/v4/media/session/MediaControllerCompat` if it knows how to handle them. Keys should be fully qualified (e.g. "com.example.MY_ARG") to avoid collisions.

| Parameters |
|---|---|
| `extras: https://developer.android.com/reference/android/os/Bundle.html!` | Optional extras for the `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder!` | this. |