public class RemoteControlClient.MetadataEditor
extends MediaMetadataEditor
| java.lang.Object | ||
| android.media.MediaMetadataEditor | ||
| android.media.RemoteControlClient.MetadataEditor | ||
该类在API级别21中已被弃用。
改为使用MediaMetadata和MediaSession 。
用于修改RemoteControlClient对象中元数据的类。 使用editMetadata(boolean)创建编辑器的实例,在该实例上设置RemoteControlClient实例的元数据。 一旦设置了所有信息,请使用apply()使其成为应为关联客户端显示的apply()数据。 一旦元数据被“应用”,就不能重用MetadataEditor的这个实例。
常量(Constants) |
|
|---|---|
int |
BITMAP_KEY_ARTWORK 内容艺术作品/专辑封面的元数据关键字。 |
Inherited constants |
|---|
android.media.MediaMetadataEditor
|
公共方法(Public methods) |
|
|---|---|
void |
apply()
|
void |
clear() 清除自MetadataEditor实例创建以来设置的所有元数据(使用 |
RemoteControlClient.MetadataEditor |
putBitmap(int key, Bitmap bitmap) 设置要在遥控器上显示的专辑/艺术作品图片。 |
RemoteControlClient.MetadataEditor |
putLong(int key, long value) 添加要显示的数字信息。 |
RemoteControlClient.MetadataEditor |
putObject(int key, Object object) 添加存储为实例的信息。 |
RemoteControlClient.MetadataEditor |
putString(int key, String value) 添加要显示的文字信息。 |
继承方法(Inherited methods) |
|
|---|---|
android.media.MediaMetadataEditor
|
|
java.lang.Object
|
|
int BITMAP_KEY_ARTWORK
内容艺术作品/专辑封面的元数据关键字。
常量值:100(0x00000064)
void apply ()
editMetadata(boolean)创建MetadataEditor实例后设置的所有元数据与editMetadata(boolean)或自clear()被调用时与RemoteControlClient clear()起来。 一旦“应用”,这个MetadataEditor就不能被重用来编辑RemoteControlClient的元数据。
void clear ()
清除自MetadataEditor实例创建以来设置的所有元数据(使用editMetadata(boolean) )。 请注意,清除元数据不会重置可编辑键(请改用removeEditableKeys() )。
RemoteControlClient.MetadataEditor putBitmap (int key, Bitmap bitmap)
设置要在遥控器上显示的专辑/艺术作品图片。
| 参数(Parameters) | |
|---|---|
key |
int: the identifier of the bitmap to set. The only valid value is BITMAP_KEY_ARTWORK |
bitmap |
Bitmap: The bitmap for the artwork, or null if there isn't any. |
| 返回(Returns) | |
|---|---|
RemoteControlClient.MetadataEditor |
Returns a reference to the same MetadataEditor object, so you can chain put calls together. |
| 抛出异常(Throws) | |
|---|---|
|
IllegalArgumentException |
IllegalArgumentException |
|
也可以看看:
RemoteControlClient.MetadataEditor putLong (int key, long value)
添加要显示的数字信息。 请注意, apply()之后添加的所有信息都不会被显示。
| 参数(Parameters) | |
|---|---|
key |
int: 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 |
long: The long value for the given key |
| 返回(Returns) | |
|---|---|
RemoteControlClient.MetadataEditor |
Returns a reference to the same MetadataEditor object, so you can chain put calls together. |
| 抛出异常(Throws) | |
|---|---|
IllegalArgumentException |
|
RemoteControlClient.MetadataEditor putObject (int key, Object object)
添加存储为实例的信息。 请注意,调用apply()后添加的任何信息都不会被MediaMetadataEditor存储的元数据的消费者使用。
| 参数(Parameters) | |
|---|---|
key |
int: the identifier of a the metadata field to set. Valid keys for a:
|
object |
Object: the metadata to add. |
| 返回(Returns) | |
|---|---|
RemoteControlClient.MetadataEditor |
Returns a reference to the same MediaMetadataEditor object, so you can chain put calls together. |
| 抛出异常(Throws) | |
|---|---|
IllegalArgumentException |
|
RemoteControlClient.MetadataEditor putString (int key, String value)
添加要显示的文字信息。 请注意, apply()之后添加的信息都不会被显示。
| 参数(Parameters) | |
|---|---|
key |
int: 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_TITLE, METADATA_KEY_WRITER. |
value |
String: The text for the given key, or null to signify there is no valid information for the field. |
| 返回(Returns) | |
|---|---|
RemoteControlClient.MetadataEditor |
Returns a reference to the same MetadataEditor object, so you can chain put calls together. |
| 抛出异常(Throws) | |
|---|---|
IllegalArgumentException |
|