Android APIs
public class

MediaDescription

extends Object
implements Parcelable
java.lang.Object
   ↳ android.media.MediaDescription

Class Overview

A simple set of metadata for a media item suitable for display. This can be created using the Builder or retrieved from existing metadata using getDescription().

Summary

Nested Classes
class MediaDescription.Builder Builder for MediaDescription objects. 
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<MediaDescription> CREATOR
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
CharSequence getDescription()
Returns a description suitable for display or null.
Bundle getExtras()
Returns any extras that were added to the description.
Bitmap getIconBitmap()
Returns a bitmap icon suitable for display or null.
Uri getIconUri()
Returns a Uri for an icon suitable for display or null.
String getMediaId()
Returns the media id or null.
CharSequence getSubtitle()
Returns a subtitle suitable for display or null.
CharSequence getTitle()
Returns a title suitable for display or null.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<MediaDescription> CREATOR

Added in API level 21

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 CharSequence getDescription ()

Added in API level 21

Returns a description suitable for display or null.

Returns
  • A description or null.

public Bundle getExtras ()

Added in API level 21

Returns any extras that were added to the description.

Returns
  • A bundle of extras or null.

public Bitmap getIconBitmap ()

Added in API level 21

Returns a bitmap icon suitable for display or null.

Returns
  • An icon or null.

public Uri getIconUri ()

Added in API level 21

Returns a Uri for an icon suitable for display or null.

Returns
  • An icon uri or null.

public String getMediaId ()

Added in API level 21

Returns the media id or null. See METADATA_KEY_MEDIA_ID.

public CharSequence getSubtitle ()

Added in API level 21

Returns a subtitle suitable for display or null.

Returns
  • A subtitle or null.

public CharSequence getTitle ()

Added in API level 21

Returns a title suitable for display or null.

Returns
  • A title or null.

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 dest, int flags)

Added in API level 21

Flatten this object in to a Parcel.

Parameters
dest 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.