PlaybackStateCompat.CustomAction.Builder

public final class PlaybackStateCompat.CustomAction.Builder


Builder for CustomAction objects.

Summary

Public constructors

Builder(String action, CharSequence name, int icon)

Creates a CustomAction builder with the id, name, and icon set.

Public methods

PlaybackStateCompat.CustomAction

Build and return the CustomAction instance with the specified values.

PlaybackStateCompat.CustomAction.Builder
setExtras(Bundle extras)

Set optional extras for the CustomAction.

Public constructors

Builder

Added in 1.1.0
public Builder(String action, CharSequence name, int icon)

Creates a CustomAction builder with the id, name, and icon set.

Parameters
String action

The action of the CustomAction.

CharSequence name

The display name of the CustomAction. This name will be displayed along side the action if the UI supports it.

int icon

The icon resource id of the CustomAction. This resource id must be in the same package as the MediaSessionCompat. It will be displayed with the custom action if the UI supports it.

Public methods

build

Added in 1.1.0
public PlaybackStateCompat.CustomAction build()

Build and return the CustomAction instance with the specified values.

setExtras

Added in 1.1.0
public PlaybackStateCompat.CustomAction.Builder setExtras(Bundle extras)

Set optional extras for the CustomAction. These extras are meant to be consumed by a MediaControllerCompat if it knows how to handle them. Keys should be fully qualified (e.g. "com.example.MY_ARG") to avoid collisions.

Parameters
Bundle extras

Optional extras for the CustomAction.