java.lang.Object | |
↳ | android.media.MediaMetadataEditor |
Known Direct Subclasses |
An abstract class for editing and storing metadata that can be published by
RemoteControlClient
. See the editMetadata(boolean)
method to instantiate a RemoteControlClient.MetadataEditor
object.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | BITMAP_KEY_ARTWORK | The metadata key for the content artwork / album art. | |||||||||
int | RATING_KEY_BY_OTHERS | The metadata key for the content's average rating, not the user's rating. | |||||||||
int | RATING_KEY_BY_USER | The metadata key for the content's user rating. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Flags the given key as being editable.
| |||||||||||
Applies all of the metadata changes that have been set since the MediaMetadataEditor instance
was created or since
clear() was called. | |||||||||||
Clears all the pending metadata changes set since the MediaMetadataEditor instance was
created or since this method was last called.
| |||||||||||
Returns the
Bitmap value for the key. | |||||||||||
Retrieves the keys flagged as editable.
| |||||||||||
Returns the long value for the key.
| |||||||||||
Returns an object representation of the value for the key
| |||||||||||
Returns the
String value for the key. | |||||||||||
Adds image.
| |||||||||||
Adds numerical information.
| |||||||||||
Adds information stored as an instance.
| |||||||||||
Adds textual information.
| |||||||||||
Causes all metadata fields to be read-only.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The metadata key for the content artwork / album art.
The metadata key for the content's average rating, not the user's rating.
The value associated with this key is a Rating
instance.
The metadata key for the content's user rating.
The value associated with this key is a Rating
instance.
This key can be flagged as "editable" (with addEditableKey(int)
) to enable
receiving user rating values through the
RemoteControlClient.OnMetadataUpdateListener
interface.
Flags the given key as being editable.
This should only be used by metadata publishers, such as RemoteControlClient
,
which will declare the metadata field as eligible to be updated, with new values
received through the RemoteControlClient.OnMetadataUpdateListener
interface.
key | the type of metadata that can be edited. The supported key is
RATING_KEY_BY_USER .
|
---|
Applies all of the metadata changes that have been set since the MediaMetadataEditor instance
was created or since clear()
was called.
Clears all the pending metadata changes set since the MediaMetadataEditor instance was
created or since this method was last called.
Note that clearing the metadata doesn't reset the editable keys
(use removeEditableKeys()
instead).
Returns the Bitmap
value for the key.
key | the BITMAP_KEY_ARTWORK key |
---|---|
defaultValue | the value returned if the key is not present |
Bitmap
value for the key, or the supplied default value if the key is
not presentIllegalArgumentException |
---|
Retrieves the keys flagged as editable.
Returns the long value for the key.
key | one of the keys supported in putLong(int, long) |
---|---|
defaultValue | the value returned if the key is not present |
IllegalArgumentException |
---|
Returns an object representation of the value for the key
key | one of the keys supported in putObject(int, Object) |
---|---|
defaultValue | the value returned if the key is not present |
IllegalArgumentException |
---|
Returns the String
value for the key.
key | one of the keys supported in putString(int, String) |
---|---|
defaultValue | the value returned if the key is not present |
String
value for the key, or the supplied default value if the key is
not presentIllegalArgumentException |
---|
Adds image.
key | the identifier of the bitmap to set. The only valid value is
BITMAP_KEY_ARTWORK |
---|---|
bitmap | The bitmap for the artwork, or null if there isn't any. |
IllegalArgumentException | |
IllegalArgumentException |
Adds numerical information.
Note that none of the information added after apply()
has been called
will be available to consumers of metadata stored by the MediaMetadataEditor.
key | the identifier of a the metadata field to set. Valid values are
METADATA_KEY_CD_TRACK_NUMBER ,
METADATA_KEY_DISC_NUMBER ,
METADATA_KEY_DURATION (with a value
expressed in milliseconds),
METADATA_KEY_YEAR . |
---|---|
value | The long value for the given key |
IllegalArgumentException |
---|
Adds information stored as an instance.
Note that none of the information added after apply()
has been called
will be available to consumers of metadata stored by the MediaMetadataEditor.
key | the identifier of a the metadata field to set. Valid keys for a:
|
---|---|
value | the metadata to add. |
IllegalArgumentException |
---|
Adds textual information.
Note that none of the information added after apply()
has been called,
will be available to consumers of metadata stored by the MediaMetadataEditor.
key | The identifier of a the metadata field to set. Valid values are
METADATA_KEY_ALBUM ,
METADATA_KEY_ALBUMARTIST ,
METADATA_KEY_TITLE ,
METADATA_KEY_ARTIST ,
METADATA_KEY_AUTHOR ,
METADATA_KEY_COMPILATION ,
METADATA_KEY_COMPOSER ,
METADATA_KEY_DATE ,
METADATA_KEY_GENRE ,
METADATA_KEY_WRITER . |
---|---|
value | The text for the given key, or null to signify there is no valid
information for the field. |
IllegalArgumentException |
---|
Causes all metadata fields to be read-only.