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

*** ** * ** ***


```
public final class PlaybackStateCompat.CustomAction.Builder
```

<br />

*** ** * ** ***

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

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

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder#Builder(java.lang.String,java.lang.CharSequence,int))(https://developer.android.com/reference/java/lang/String.html action, https://developer.android.com/reference/java/lang/CharSequence.html name, int icon)` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction` | `[build](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder#build())()` **This method is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder` | `[setExtras](https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction.Builder#setExtras(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html extras)` **This method 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)

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

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

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

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html action` | The action of the `https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. |
| `https://developer.android.com/reference/java/lang/CharSequence.html name` | The display name of the `https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. This name will be displayed along side the action if the UI supports it. |
| `int icon` | The icon resource id of the `https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. This resource id must be in the same package as the `https://developer.android.com/reference/android/support/v4/media/session/MediaSessionCompat`. It will be displayed with the custom action if the UI supports it. |

## Public methods

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

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

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

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

| Returns |
|---|---|
| `https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction` | A new `https://developer.android.com/reference/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)

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

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

Set optional extras for the `https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. These extras are meant to be consumed by a `https://developer.android.com/reference/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 |
|---|---|
| `https://developer.android.com/reference/android/os/Bundle.html extras` | Optional extras for the `https://developer.android.com/reference/android/support/v4/media/session/PlaybackStateCompat.CustomAction`. |

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