added in version 22.1.0
belongs to Maven artifact com.android.support:support-media-compat:28.0.0-alpha1

PlaybackStateCompat.Builder

public static final class PlaybackStateCompat.Builder
extends Object

java.lang.Object
   ↳ android.support.v4.media.session.PlaybackStateCompat.Builder


Builder for PlaybackStateCompat objects.

Summary

Public constructors

PlaybackStateCompat.Builder()

Create an empty Builder.

PlaybackStateCompat.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 was deprecated in API level 25.4.0. 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.

PlaybackStateCompat.Builder setState(int state, long position, float playbackSpeed)

Set the current state of playback.

PlaybackStateCompat.Builder setState(int state, long position, float playbackSpeed, long updateTime)

Set the current state of playback.

Inherited methods

From class java.lang.Object