Most visited

Recently visited

Added in API level 21

PlaybackState.CustomAction.Builder

public static final class PlaybackState.CustomAction.Builder
extends Object

java.lang.Object
   ↳ android.media.session.PlaybackState.CustomAction.Builder


Builder for PlaybackState.CustomAction objects.

Summary

Public constructors

PlaybackState.CustomAction.Builder(String action, CharSequence name, int icon)

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

Public methods

PlaybackState.CustomAction build()

Build and return the PlaybackState.CustomAction instance with the specified values.

PlaybackState.CustomAction.Builder setExtras(Bundle extras)

Set optional extras for the PlaybackState.CustomAction.

Inherited methods

From class java.lang.Object

Public constructors

PlaybackState.CustomAction.Builder

Added in API level 21
PlaybackState.CustomAction.Builder (String action, 
                CharSequence name, 
                int icon)

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

Parameters
action String: The action of the PlaybackState.CustomAction.
name CharSequence: The display name of the PlaybackState.CustomAction. This name will be displayed along side the action if the UI supports it.
icon int: The icon resource id of the PlaybackState.CustomAction. This resource id must be in the same package as the MediaSession. It will be displayed with the custom action if the UI supports it.

Public methods

build

Added in API level 21
PlaybackState.CustomAction build ()

Build and return the PlaybackState.CustomAction instance with the specified values.

Returns
PlaybackState.CustomAction A new PlaybackState.CustomAction instance.

setExtras

Added in API level 21
PlaybackState.CustomAction.Builder setExtras (Bundle extras)

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

Parameters
extras Bundle: Optional extras for the PlaybackState.CustomAction.
Returns
PlaybackState.CustomAction.Builder this.

Hooray!