public static final class PlaybackStateCompat.Builder
extends Object


Builder for PlaybackStateCompat objects.


Public constructors


Create an empty Builder.

Builder(PlaybackStateCompat source)

Create a Builder using a PlaybackStateCompat instance to set the initial values.

Public methods

PlaybackStateCompat.Builder addCustomAction(String action, String name, int icon)

Add a custom action to the playback state.

PlaybackStateCompat.Builder addCustomAction(PlaybackStateCompat.CustomAction customAction)

Add a custom action to the playback state.

PlaybackStateCompat build()

Creates the playback state object.

PlaybackStateCompat.Builder setActions(long capabilities)

Set the current capabilities available on this session.

PlaybackStateCompat.Builder setActiveQueueItemId(long id)

Set the active item in the play queue by specifying its id.

PlaybackStateCompat.Builder setBufferedPosition(long bufferPosition)

Set the current buffered position in ms.

PlaybackStateCompat.Builder setErrorMessage(CharSequence errorMessage)

This method is deprecated. Use setErrorMessage(int, CharSequence) instead.

PlaybackStateCompat.Builder setErrorMessage(int errorCode, CharSequence errorMessage)

Set the error code with an optional user readable error message.

PlaybackStateCompat.Builder setExtras(Bundle extras)

Set any custom extras to be included with the playback state.