Most visited

Recently visited

MediaBrowserCompat.MediaItem

public static class MediaBrowserCompat.MediaItem
extends Object implements Parcelable

java.lang.Object
    android.support.v4.media.MediaBrowserCompat.MediaItem


一个包含单个媒体项目信息的类,用于浏览媒体。

摘要(Summary)

常量(Constants)

int FLAG_BROWSABLE

标志:表示该项目有其自己的子项。

int FLAG_PLAYABLE

标志:表示该项目可以播放。

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<MediaBrowserCompat.MediaItem> CREATOR

Public constructors

MediaBrowserCompat.MediaItem(MediaDescriptionCompat description, int flags)

创建一个新的MediaItem用于浏览媒体。

公共方法(Public methods)

int describeContents()

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

MediaDescriptionCompat getDescription()

返回介质的描述。

int getFlags()

获取该项目的标志。

String getMediaId()

返回此项目的媒体ID。

boolean isBrowsable()

返回此项目是否可浏览。

boolean isPlayable()

返回此项目是否可播放。

String toString()

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

void writeToParcel(Parcel out, int flags)

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

继承方法(Inherited methods)

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

常量(Constants)

FLAG_BROWSABLE

int FLAG_BROWSABLE

标志:表示该项目有其自己的子项。

常数值:1(0x00000001)

FLAG_PLAYABLE

int FLAG_PLAYABLE

标志:表示该项目可以播放。

这个项目的ID可以传递给 playFromMediaId(String, Bundle)开始播放它。

常量值:2(0x00000002)

Fields

Public constructors

MediaBrowserCompat.MediaItem

MediaBrowserCompat.MediaItem (MediaDescriptionCompat description, 
                int flags)

创建一个新的MediaItem用于浏览媒体。

参数(Parameters)
description MediaDescriptionCompat: The description of the media, which must include a media id.
flags int: The flags for this item.

公共方法(Public methods)

describeContents

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.

getDescription

MediaDescriptionCompat getDescription ()

返回介质的描述。

返回(Returns)
MediaDescriptionCompat

getFlags

int getFlags ()

获取该项目的标志。

返回(Returns)
int

getMediaId

String getMediaId ()

返回此项目的媒体ID。

返回(Returns)
String

isBrowsable

boolean isBrowsable ()

返回此项目是否可浏览。

返回(Returns)
boolean

也可以看看:

isPlayable

boolean isPlayable ()

返回此项目是否可播放。

返回(Returns)
boolean

也可以看看:

toString

String toString ()

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

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

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

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

writeToParcel

void writeToParcel (Parcel out, 
                int flags)

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

参数(Parameters)
out 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!