Most visited

Recently visited

Added in API level 21

PlaybackState.CustomAction

public static final class PlaybackState.CustomAction
extends Object implements Parcelable

java.lang.Object
    android.media.session.PlaybackState.CustomAction


CustomActions可用于通过向 MediaControllers公开应用特定操作来扩展标准传输控件的功能。

摘要(Summary)

Nested classes

class PlaybackState.CustomAction.Builder

PlaybackState.CustomAction对象的生成器。

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<PlaybackState.CustomAction> CREATOR

公共方法(Public methods)

int describeContents()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。

String getAction()

返回 PlaybackState.CustomAction的动作。

Bundle getExtras()

返回提供关于操作的其他特定于应用程序的信息的附加信息,如果没有,则返回null。

int getIcon()

返回 MediaSession's包中图标的资源ID。

CharSequence getName()

返回此操作的显示名称。

String toString()

返回对象的字符串表示形式。

void writeToParcel(Parcel dest, int flags)

将此对象平铺到一个包裹中。

继承方法(Inherited methods)

From class java.lang.Object
From interface android.os.Parcelable

Fields

CREATOR

Added in API level 21
Creator<PlaybackState.CustomAction> CREATOR

公共方法(Public methods)

describeContents

Added in API level 21
int describeContents ()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象将在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。

返回(Returns)
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getAction

Added in API level 21
String getAction ()

返回 PlaybackState.CustomAction的动作。

返回(Returns)
String The action of the PlaybackState.CustomAction.

getExtras

Added in API level 21
Bundle getExtras ()

返回提供关于操作的其他特定于应用程序的信息的附加信息,如果没有,则返回null。 如果知道如何处理它们,这些参数将被MediaController使用。

返回(Returns)
Bundle Optional arguments for the PlaybackState.CustomAction.

getIcon

Added in API level 21
int getIcon ()

返回 MediaSession's包中图标的资源ID。

返回(Returns)
int The resource id of the icon in the MediaSession's package.

getName

Added in API level 21
CharSequence getName ()

返回此操作的显示名称。 例如“收藏”

返回(Returns)
CharSequence The display name of this PlaybackState.CustomAction.

toString

Added in API level 21
String toString ()

返回对象的字符串表示形式。 通常, toString方法返回一个“文本表示”该对象的字符串。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。

ObjecttoString方法返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @ ”以及对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

返回(Returns)
String a string representation of the object.

writeToParcel

Added in API level 21
void writeToParcel (Parcel dest, 
                int flags)

将此对象平铺到一个包裹中。

参数(Parameters)
dest Parcel: The Parcel in which the object should be written.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Hooray!