# Print output for @column tags ?> PlaybackStateEvent.Builder - Android SDK | Android Developers

Most visited

Recently visited

PlaybackStateEvent.Builder

public static final class PlaybackStateEvent.Builder
extends Object

java.lang.Object
   ↳ android.media.metrics.PlaybackStateEvent.Builder


A builder for PlaybackStateEvent

Summary

Public constructors

Builder()

Creates a new Builder.

Public methods

PlaybackStateEvent build()

Builds the instance.

PlaybackStateEvent.Builder setMetricsBundle(Bundle metricsBundle)

Sets metrics-related information that is not supported by dedicated methods.

PlaybackStateEvent.Builder setState(int value)

Sets playback state.

PlaybackStateEvent.Builder setTimeSinceCreatedMillis(long value)

Sets timestamp since the creation in milliseconds.

Inherited methods

Public constructors

Builder

public Builder ()

Creates a new Builder.

Public methods

build

public PlaybackStateEvent build ()

Builds the instance.

Returns
PlaybackStateEvent This value cannot be null.

setMetricsBundle

public PlaybackStateEvent.Builder setMetricsBundle (Bundle metricsBundle)

Sets metrics-related information that is not supported by dedicated methods.

It is intended to be used for backwards compatibility by the metrics infrastructure.

Parameters
metricsBundle Bundle: This value cannot be null.

Returns
PlaybackStateEvent.Builder This value cannot be null.

setState

public PlaybackStateEvent.Builder setState (int value)

Sets playback state.

Parameters
value int: Value is PlaybackStateEvent.STATE_NOT_STARTED, PlaybackStateEvent.STATE_JOINING_BACKGROUND, PlaybackStateEvent.STATE_JOINING_FOREGROUND, PlaybackStateEvent.STATE_PLAYING, PlaybackStateEvent.STATE_PAUSED, PlaybackStateEvent.STATE_SEEKING, PlaybackStateEvent.STATE_BUFFERING, PlaybackStateEvent.STATE_PAUSED_BUFFERING, PlaybackStateEvent.STATE_SUPPRESSED, PlaybackStateEvent.STATE_SUPPRESSED_BUFFERING, PlaybackStateEvent.STATE_ENDED, PlaybackStateEvent.STATE_STOPPED, PlaybackStateEvent.STATE_FAILED, PlaybackStateEvent.STATE_INTERRUPTED_BY_AD, or PlaybackStateEvent.STATE_ABANDONED

Returns
PlaybackStateEvent.Builder This value cannot be null.

setTimeSinceCreatedMillis

public PlaybackStateEvent.Builder setTimeSinceCreatedMillis (long value)

Sets timestamp since the creation in milliseconds.

Parameters
value long: the timestamp since the creation in milliseconds. -1 indicates the value is unknown. Value is -1 or greater

Returns
PlaybackStateEvent.Builder This value cannot be null.

See also: