PlaybackState.CustomAction.Builder


public static final class PlaybackState.CustomAction.Builder
extends Object

java.lang.Object
   ↳ android.media.session.PlaybackState.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

PlaybackState.CustomAction build()

Build and return the CustomAction instance with the specified values.

PlaybackState.CustomAction.Builder setExtras(Bundle extras)

Set optional extras for the CustomAction.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(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 wait(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 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
public Builder (String action, 
                CharSequence name, 
                int icon)

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

Parameters
action String: The action of the CustomAction.

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

icon int: The icon resource id of the 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
public PlaybackState.CustomAction build ()

Build and return the CustomAction instance with the specified values.

Returns
PlaybackState.CustomAction A new CustomAction instance.

setExtras

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

Set optional extras for the 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 CustomAction.