lightbulb_outline Please take our October 2018 developer survey. Start survey
added in version 22.1.0
belongs to Maven artifact androidx.media:media:1.0.0

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

added in version 22.1.0
public static final Creator<MediaSessionCompat.Token> CREATOR

Public methods

describeContents

added in version 22.1.0
public int describeContents ()

Returns
int

equals

public boolean equals (Object obj)

Parameters
obj Object

Returns
boolean

fromToken

added in version 22.1.0
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

added in version 22.1.0
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

added in version 22.1.0
public void writeToParcel (Parcel dest, 
                int flags)

Parameters
dest Parcel

flags int