Skip to content

Most visited

Recently visited

navigation

MediaDescription

public class MediaDescription
extends Object implements Parcelable

java.lang.Object
   ↳ android.media.MediaDescription


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. 

Constants

long BT_FOLDER_TYPE_ALBUMS

The type of folder that contains folders categorized by album as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_ARTISTS

The type of folder that contains folders categorized by artist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_GENRES

The type of folder that contains folders categorized by genre as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_MIXED

The type of folder that is unknown or contains media elements of mixed types as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_PLAYLISTS

The type of folder that contains folders categorized by playlist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_TITLES

The type of folder that contains media elements only as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_YEARS

The type of folder that contains folders categorized by year as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

String EXTRA_BT_FOLDER_TYPE

Used as a long extra field to indicate the bluetooth folder type of the media item as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

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 instance's marshaled 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.

Uri getMediaUri()

Returns a Uri representing this content 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 representation of the object.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

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

Constants

BT_FOLDER_TYPE_ALBUMS

long BT_FOLDER_TYPE_ALBUMS

The type of folder that contains folders categorized by album as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 2 (0x0000000000000002)

BT_FOLDER_TYPE_ARTISTS

long BT_FOLDER_TYPE_ARTISTS

The type of folder that contains folders categorized by artist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 3 (0x0000000000000003)

BT_FOLDER_TYPE_GENRES

long BT_FOLDER_TYPE_GENRES

The type of folder that contains folders categorized by genre as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 4 (0x0000000000000004)

BT_FOLDER_TYPE_MIXED

long BT_FOLDER_TYPE_MIXED

The type of folder that is unknown or contains media elements of mixed types as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 0 (0x0000000000000000)

BT_FOLDER_TYPE_PLAYLISTS

long BT_FOLDER_TYPE_PLAYLISTS

The type of folder that contains folders categorized by playlist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 5 (0x0000000000000005)

BT_FOLDER_TYPE_TITLES

long BT_FOLDER_TYPE_TITLES

The type of folder that contains media elements only as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 1 (0x0000000000000001)

BT_FOLDER_TYPE_YEARS

long BT_FOLDER_TYPE_YEARS

The type of folder that contains folders categorized by year as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 6 (0x0000000000000006)

EXTRA_BT_FOLDER_TYPE

String EXTRA_BT_FOLDER_TYPE

Used as a long extra field to indicate the bluetooth folder type of the media item as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. This is valid only for MediaBrowser.MediaItem with FLAG_BROWSABLE. The value should be one of the following:

See also:

Constant Value: "android.media.extra.BT_FOLDER_TYPE"

Fields

CREATOR

added in API level 21
Creator<MediaDescription> CREATOR

Public methods

describeContents

added in API level 21
int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getDescription

added in API level 21
CharSequence getDescription ()

Returns a description suitable for display or null.

Returns
CharSequence A description or null.

getExtras

added in API level 21
Bundle getExtras ()

Returns any extras that were added to the description.

Returns
Bundle A bundle of extras or null.

getIconBitmap

added in API level 21
Bitmap getIconBitmap ()

Returns a bitmap icon suitable for display or null.

Returns
Bitmap An icon or null.

getIconUri

added in API level 21
Uri getIconUri ()

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

Returns
Uri An icon uri or null.

getMediaId

added in API level 21
String getMediaId ()

Returns the media id or null. See METADATA_KEY_MEDIA_ID.

Returns
String

getMediaUri

added in API level 23
Uri getMediaUri ()

Returns a Uri representing this content or null.

Returns
Uri A media Uri or null.

getSubtitle

added in API level 21
CharSequence getSubtitle ()

Returns a subtitle suitable for display or null.

Returns
CharSequence A subtitle or null.

getTitle

added in API level 21
CharSequence getTitle ()

Returns a title suitable for display or null.

Returns
CharSequence A title or null.

toString

added in API level 21
String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

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

Returns
String a string representation of the object.

writeToParcel

added in API level 21
void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

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.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.