Most visited

Recently visited

MediaDescriptionCompat

public final class MediaDescriptionCompat
extends Object implements Parcelable

java.lang.Object
    android.support.v4.media.MediaDescriptionCompat


适合显示的媒体项目的一组简单元数据。 这可以使用Builder创建,也可以使用getDescription()从现有元数据中getDescription()

摘要(Summary)

Nested classes

class MediaDescriptionCompat.Builder

MediaDescriptionCompat对象的生成器。

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<MediaDescriptionCompat> CREATOR

公共方法(Public methods)

int describeContents()

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

static MediaDescriptionCompat fromMediaDescription(Object descriptionObj)

从框架 MediaDescription对象创建一个实例。

CharSequence getDescription()

返回适合显示的描述或null。

Bundle getExtras()

返回添加到描述中的任何附加内容。

Bitmap getIconBitmap()

返回适合显示的位图图标或为空。

Uri getIconUri()

返回适合显示的图标的Uri或null。

Object getMediaDescription()

获取底层框架 MediaDescription对象。

String getMediaId()

返回媒体ID或null。

Uri getMediaUri()

返回表示此内容的Uri或null。

CharSequence getSubtitle()

返回适合显示的字幕或为空。

CharSequence getTitle()

返回适合显示的标题或为空。

String toString()

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

void writeToParcel(Parcel dest, int flags)

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

继承方法(Inherited methods)

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

Fields

CREATOR

Creator<MediaDescriptionCompat> CREATOR

公共方法(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.

fromMediaDescription

MediaDescriptionCompat fromMediaDescription (Object descriptionObj)

从框架 MediaDescription对象创建一个实例。

此方法仅在API 21+上受支持。

参数(Parameters)
descriptionObj Object: A MediaDescription object, or null if none.
返回(Returns)
MediaDescriptionCompat An equivalent MediaMetadataCompat object, or null if none.

getDescription

CharSequence getDescription ()

返回适合显示的描述或null。

返回(Returns)
CharSequence A description or null.

getExtras

Bundle getExtras ()

返回添加到描述中的任何附加内容。

返回(Returns)
Bundle A bundle of extras or null.

getIconBitmap

Bitmap getIconBitmap ()

返回适合显示的位图图标或为空。

返回(Returns)
Bitmap An icon or null.

getIconUri

Uri getIconUri ()

返回适合显示的图标的Uri或null。

返回(Returns)
Uri An icon uri or null.

getMediaDescription

Object getMediaDescription ()

获取底层框架 MediaDescription对象。

此方法仅在 LOLLIPOP及更高版本上受支持。

返回(Returns)
Object An equivalent MediaDescription object, or null if none.

getMediaId

String getMediaId ()

返回媒体ID或null。 METADATA_KEY_MEDIA_ID

返回(Returns)
String

getMediaUri

Uri getMediaUri ()

返回表示此内容的Uri或null。

返回(Returns)
Uri A media Uri or null.

getSubtitle

CharSequence getSubtitle ()

返回适合显示的字幕或为空。

返回(Returns)
CharSequence A subtitle or null.

getTitle

CharSequence getTitle ()

返回适合显示的标题或为空。

返回(Returns)
CharSequence A title or null.

toString

String toString ()

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

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

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

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

writeToParcel

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!