public static class MediaBrowser.MediaItem
extends Object implements Parcelable
| java.lang.Object | |
| android.media.browse.MediaBrowser.MediaItem | |
一个包含单个媒体项目信息的类,用于浏览媒体。
常量(Constants) |
|
|---|---|
int |
FLAG_BROWSABLE 标志:表示该项目有其自己的子项。 |
int |
FLAG_PLAYABLE 标志:表示该项目可以播放。 |
Inherited constants |
|---|
android.os.Parcelable
|
Fields |
|
|---|---|
public static final Creator<MediaBrowser.MediaItem> |
CREATOR |
Public constructors |
|
|---|---|
MediaBrowser.MediaItem(MediaDescription description, int flags) 创建一个新的MediaItem用于浏览媒体。 |
|
公共方法(Public methods) |
|
|---|---|
int |
describeContents() 描述此Parcelable实例的封送表示中包含的特殊对象的种类。 |
MediaDescription |
getDescription() 返回介质的描述。 |
int |
getFlags() 获取该项目的标志。 |
String |
getMediaId() 返回此项目的媒体ID。 |
boolean |
isBrowsable() 返回此项目是否可浏览。 |
boolean |
isPlayable() 返回此项目是否可播放。 |
String |
toString() 返回对象的字符串表示形式。 |
void |
writeToParcel(Parcel out, int flags) 将此对象平铺到一个包裹中。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
android.os.Parcelable
|
|
int FLAG_PLAYABLE
标志:表示该项目可以播放。
该物品的ID可能会传递到 playFromMediaId(String, Bundle)开始播放。
常量值:2(0x00000002)
MediaBrowser.MediaItem (MediaDescription description, int flags)
创建一个新的MediaItem用于浏览媒体。
| 参数(Parameters) | |
|---|---|
description |
MediaDescription: The description of the media, which must include a media id. |
flags |
int: The flags for this item. |
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. |
MediaDescription getDescription ()
返回介质的描述。
| 返回(Returns) | |
|---|---|
MediaDescription |
|
String toString ()
返回对象的字符串表示形式。 通常, toString方法返回一个“文本表示”该对象的字符串。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。
类Object的toString方法返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @ ”以及对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| 返回(Returns) | |
|---|---|
String |
a string representation of the object. |
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. |