Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction.Builder#inhmethods)

# PlaybackState.CustomAction.Builder

*** ** * ** ***

` public static final class PlaybackState.CustomAction.Builder `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.session.PlaybackState.CustomAction.Builder |

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction` objects.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction.Builder#Builder(java.lang.String,%20java.lang.CharSequence,%20int)(https://developer.android.com/reference/java/lang/String action, https://developer.android.com/reference/java/lang/CharSequence name, int icon) ` Creates a `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction` builder with the id, name, and icon set. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction` | ` https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction.Builder#build()() ` Build and return the `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction` instance with the specified values. |
| ` https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction.Builder` | ` https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction.Builder#setExtras(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle extras) ` Set optional extras for the `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction`. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Builder

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (String action, 
                CharSequence name, 
                int icon)
```

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

<br />

| Parameters ||
|---|---|
| `action` | `String`: The action of the `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction`. <br /> |
| `name` | `CharSequence`: The display name of the `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction`. This name will be displayed along side the action if the UI supports it. <br /> |
| `icon` | `int`: The icon resource id of the `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction`. This resource id must be in the same package as the `https://developer.android.com/reference/android/media/session/MediaSession`. It will be displayed with the custom action if the UI supports it. <br /> |

## Public methods

### build

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PlaybackState.CustomAction build ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction` | A new `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction` instance. <br /> |

### setExtras

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PlaybackState.CustomAction.Builder setExtras (Bundle extras)
```

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

<br />

| Parameters ||
|---|---|
| `extras` | `Bundle`: Optional extras for the `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/media/session/PlaybackState.CustomAction.Builder` | this. <br /> |