Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 26.0.0-alpha1
belongs to Maven artifact androidx.media:media:1.0.0-rc01

MediaSessionCompat.Token

public static final class MediaSessionCompat.Token
extends Object implements Parcelable

java.lang.Object
   ↳ android.support.v4.media.session.MediaSessionCompat.Token


Represents an ongoing session. This may be passed to apps by the session owner to allow them to create a MediaControllerCompat to communicate with the session.

Summary

Inherited constants

Fields

public static final Creator<MediaSessionCompat.Token> CREATOR

Public methods

int describeContents()
boolean equals(Object obj)
static MediaSessionCompat.Token fromToken(Object token)

Creates a compat Token from a framework MediaSession.Token object.

Object getToken()

Gets the underlying framework MediaSession.Token object.

int hashCode()
void writeToParcel(Parcel dest, int flags)

Inherited methods

Fields

CREATOR

public static final Creator<MediaSessionCompat.Token> CREATOR

Public methods

describeContents

public int describeContents ()

Returns
int

equals

public boolean equals (Object obj)

Parameters
obj Object

Returns
boolean

fromToken

public static MediaSessionCompat.Token fromToken (Object token)

Creates a compat Token from a framework MediaSession.Token object.

This method is only supported on Build.VERSION_CODES.LOLLIPOP and later.

Parameters
token Object: The framework token object.

Returns
MediaSessionCompat.Token A compat Token for use with MediaControllerCompat.

getToken

public Object getToken ()

Gets the underlying framework MediaSession.Token object.

This method is only supported on API 21+.

Returns
Object The underlying MediaSession.Token object, or null if none.

hashCode

public int hashCode ()

Returns
int

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

Parameters
dest Parcel

flags int