public
static
final
class
MediaMetadataCompat.Builder
extends Object
java.lang.Object | |
↳ | android.support.v4.media.MediaMetadataCompat.Builder |
Use to build MediaMetadata objects. The system defined metadata keys must use the appropriate data type.
Public constructors | |
---|---|
MediaMetadataCompat.Builder()
Create an empty Builder. |
|
MediaMetadataCompat.Builder(MediaMetadataCompat source)
Create a Builder using a |
Public methods | |
---|---|
MediaMetadataCompat
|
build()
Creates a |
MediaMetadataCompat.Builder
|
putBitmap(String key, Bitmap value)
Put a |
MediaMetadataCompat.Builder
|
putLong(String key, long value)
Put a long value into the metadata. |
MediaMetadataCompat.Builder
|
putRating(String key, RatingCompat value)
Put a |
MediaMetadataCompat.Builder
|
putString(String key, String value)
Put a String value into the metadata. |
MediaMetadataCompat.Builder
|
putText(String key, CharSequence value)
Put a CharSequence value into the metadata. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
MediaMetadataCompat.Builder ()
Create an empty Builder. Any field that should be included in the
MediaMetadataCompat
must be added.
MediaMetadataCompat.Builder (MediaMetadataCompat source)
Create a Builder using a MediaMetadataCompat
instance to set the
initial values. All fields in the source metadata will be included in
the new metadata. Fields can be overwritten by adding the same key.
MediaMetadataCompat build ()
Creates a MediaMetadataCompat
instance with the specified fields.
Returns | |
---|---|
MediaMetadataCompat |
The new MediaMetadata instance |
MediaMetadataCompat.Builder putBitmap (String key, Bitmap value)
Put a Bitmap
into the metadata. Custom keys may be used, but
if the METADATA_KEYs defined in this class are used they may only be
one of the following:
Parameters | |
---|---|
key |
String :
The key for referencing this value |
value |
Bitmap :
The Bitmap to store |
Returns | |
---|---|
MediaMetadataCompat.Builder |
The Builder to allow chaining |
MediaMetadataCompat.Builder putLong (String key, long value)
Put a long value into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:
METADATA_KEY_DURATION
METADATA_KEY_TRACK_NUMBER
METADATA_KEY_NUM_TRACKS
METADATA_KEY_DISC_NUMBER
METADATA_KEY_YEAR
Parameters | |
---|---|
key |
String :
The key for referencing this value |
value |
long :
The String value to store |
Returns | |
---|---|
MediaMetadataCompat.Builder |
The Builder to allow chaining |
MediaMetadataCompat.Builder putRating (String key, RatingCompat value)
Put a RatingCompat
into the metadata. Custom keys may be used, but
if the METADATA_KEYs defined in this class are used they may only be
one of the following:
Parameters | |
---|---|
key |
String :
The key for referencing this value |
value |
RatingCompat :
The String value to store |
Returns | |
---|---|
MediaMetadataCompat.Builder |
The Builder to allow chaining |
MediaMetadataCompat.Builder putString (String key, String value)
Put a String value into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:
METADATA_KEY_TITLE
METADATA_KEY_ARTIST
METADATA_KEY_ALBUM
METADATA_KEY_AUTHOR
METADATA_KEY_WRITER
METADATA_KEY_COMPOSER
METADATA_KEY_DATE
METADATA_KEY_GENRE
METADATA_KEY_ALBUM_ARTIST
METADATA_KEY_ART_URI
METADATA_KEY_ALBUM_ART_URI
METADATA_KEY_DISPLAY_TITLE
METADATA_KEY_DISPLAY_SUBTITLE
METADATA_KEY_DISPLAY_DESCRIPTION
METADATA_KEY_DISPLAY_ICON_URI
Parameters | |
---|---|
key |
String :
The key for referencing this value |
value |
String :
The String value to store |
Returns | |
---|---|
MediaMetadataCompat.Builder |
The Builder to allow chaining |
MediaMetadataCompat.Builder putText (String key, CharSequence value)
Put a CharSequence value into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:
METADATA_KEY_TITLE
METADATA_KEY_ARTIST
METADATA_KEY_ALBUM
METADATA_KEY_AUTHOR
METADATA_KEY_WRITER
METADATA_KEY_COMPOSER
METADATA_KEY_DATE
METADATA_KEY_GENRE
METADATA_KEY_ALBUM_ARTIST
METADATA_KEY_ART_URI
METADATA_KEY_ALBUM_ART_URI
METADATA_KEY_DISPLAY_TITLE
METADATA_KEY_DISPLAY_SUBTITLE
METADATA_KEY_DISPLAY_DESCRIPTION
METADATA_KEY_DISPLAY_ICON_URI
Parameters | |
---|---|
key |
String :
The key for referencing this value |
value |
CharSequence :
The CharSequence value to store |
Returns | |
---|---|
MediaMetadataCompat.Builder |
The Builder to allow chaining |