Android APIs
public static class

MediaBrowser.MediaItem

extends Object
implements Parcelable
java.lang.Object
   ↳ android.media.browse.MediaBrowser.MediaItem

Summary

Constants
int FLAG_BROWSABLE Flag: Indicates that the item has children of its own.
int FLAG_PLAYABLE Flag: Indicates that the item is playable.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<MediaBrowser.MediaItem> CREATOR
Public Constructors
MediaBrowser.MediaItem(MediaDescription description, int flags)
Create a new MediaItem for use in browsing media.
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
MediaDescription getDescription()
Returns the description of the media.
int getFlags()
Gets the flags of the item.
String getMediaId()
Returns the media id for this item.
boolean isBrowsable()
Returns whether this item is browsable.
boolean isPlayable()
Returns whether this item is playable.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel out, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int FLAG_BROWSABLE

Added in API level 21

Flag: Indicates that the item has children of its own.

Constant Value: 1 (0x00000001)

public static final int FLAG_PLAYABLE

Added in API level 21

Flag: Indicates that the item is playable.

The id of this item may be passed to playFromMediaId(String, Bundle) to start playing it.

Constant Value: 2 (0x00000002)

Fields

public static final Creator<MediaBrowser.MediaItem> CREATOR

Added in API level 21

Public Constructors

public MediaBrowser.MediaItem (MediaDescription description, int flags)

Added in API level 21

Create a new MediaItem for use in browsing media.

Parameters
description The description of the media, which must include a media id.
flags The flags for this item.

Public Methods

public int describeContents ()

Added in API level 21

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public MediaDescription getDescription ()

Added in API level 21

Returns the description of the media.

public int getFlags ()

Added in API level 21

Gets the flags of the item.

public String getMediaId ()

Added in API level 21

Returns the media id for this item.

public boolean isBrowsable ()

Added in API level 21

Returns whether this item is browsable.

See Also

public boolean isPlayable ()

Added in API level 21

Returns whether this item is playable.

See Also

public String toString ()

Added in API level 21

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

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

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel out, int flags)

Added in API level 21

Flatten this object in to a Parcel.

Parameters
out The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.