# RemoteController.MetadataEditor

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# MetadataEditor

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/RemoteController.MetadataEditor "View this page in Java")  

```
class MetadataEditor : MediaMetadataEditor
```

|---|---|------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                    |||
| ↳ | [android.media.MediaMetadataEditor](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor)                             ||
|   | ↳ | [android.media.RemoteController.MetadataEditor](https://developer.android.com/reference/kotlin/android/media/RemoteController.MetadataEditor#) |

*** ** * ** ***

| **This class was deprecated in API level 29.**
|
| Deprecated in Java.

A class to read the metadata published by a[RemoteControlClient](https://developer.android.com/reference/kotlin/android/media/RemoteControlClient), or send a[RemoteControlClient](https://developer.android.com/reference/kotlin/android/media/RemoteControlClient)new values for keys that can be edited.

## Summary

| Inherited constants ||
|---|---|
| From class[MediaMetadataEditor](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor) |----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [BITMAP_KEY_ARTWORK](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#BITMAP_KEY_ARTWORK:kotlin.Int) <br /> The metadata key for the content artwork / album art. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RATING_KEY_BY_OTHERS](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#RATING_KEY_BY_OTHERS:kotlin.Int) <br /> The metadata key for the content's average rating, not the user's rating. The value associated with this key is a[Rating](https://developer.android.com/reference/kotlin/android/media/Rating)instance. <br />                                                                                                                                                                                                                                                                                                                                                                                      | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RATING_KEY_BY_USER](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#RATING_KEY_BY_USER:kotlin.Int) <br /> The metadata key for the content's user rating. The value associated with this key is a[Rating](https://developer.android.com/reference/kotlin/android/media/Rating)instance. This key can be flagged as "editable" (with[addEditableKey(int)](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#addEditableKey(kotlin.Int))) to enable receiving user rating values through the[android.media.RemoteControlClient.OnMetadataUpdateListener](https://developer.android.com/reference/kotlin/android/media/RemoteControlClient.OnMetadataUpdateListener)interface. <br /> | ||

|                                                                                                                                                                                                                                                                             Public methods                                                                                                                                                                                                                                                                              ||
|----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [apply](https://developer.android.com/reference/kotlin/android/media/RemoteController.MetadataEditor#apply())`()` Applies all of the metadata changes that have been set since the MediaMetadataEditor instance was created with[RemoteController.editMetadata()](https://developer.android.com/reference/kotlin/android/media/RemoteController#editMetadata())or since[clear()](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#clear())was called. |

| Inherited functions ||
|---|---|
| From class[MediaMetadataEditor](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor) |----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                             | [addEditableKey](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#addEditableKey(kotlin.Int))`(`key:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Flags the given key as being editable. This should only be used by metadata publishers, such as[RemoteControlClient](https://developer.android.com/reference/kotlin/android/media/RemoteControlClient), which will declare the metadata field as eligible to be updated, with new values received through the[RemoteControlClient.OnMetadataUpdateListener](https://developer.android.com/reference/kotlin/android/media/RemoteControlClient.OnMetadataUpdateListener)interface. <br /> | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                             | [clear](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#clear())`()` <br /> 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()](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#removeEditableKeys())instead). <br />                                                                                                                                                                                                                                                 | | [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)!                  | [getBitmap](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#getBitmap(kotlin.Int,%20android.graphics.Bitmap))`(`key:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `defaultValue:` `[Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)!`)` <br /> Returns the[Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)value for the key. <br />                                                                                                                                                                                                                                  | | [IntArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)!                   | [getEditableKeys](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#getEditableKeys())`()` <br /> Retrieves the keys flagged as editable. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)                             | [getLong](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#getLong(kotlin.Int,%20kotlin.Long))`(`key:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `defaultValue:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Returns the long value for the key. <br />                                                                                                                                                                                                                                                                                                                                             | | [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!                              | [getObject](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#getObject(kotlin.Int,%20kotlin.Any))`(`key:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `defaultValue:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!`)` <br /> Returns an object representation of the value for the key <br />                                                                                                                                                                                                                                                                                                                     | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!                        | [getString](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#getString(kotlin.Int,%20kotlin.String))`(`key:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `defaultValue:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Returns the[String](https://developer.android.com/reference/kotlin/java/lang/String.html#)value for the key. <br />                                                                                                                                                                                                                                                         | | [MediaMetadataEditor](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor)! | [putBitmap](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#putBitmap(kotlin.Int,%20android.graphics.Bitmap))`(`key:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `bitmap:` `[Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)!`)` <br /> Adds image. <br />                                                                                                                                                                                                                                                                                                                                                | | [MediaMetadataEditor](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor)! | [putLong](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#putLong(kotlin.Int,%20kotlin.Long))`(`key:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Adds numerical information. Note that none of the information added after[apply()](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#apply())has been called will be available to consumers of metadata stored by the MediaMetadataEditor. <br />                                                                                                              | | [MediaMetadataEditor](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor)! | [putObject](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#putObject(kotlin.Int,%20kotlin.Any))`(`key:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `value:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!`)` <br /> Adds information stored as an instance. Note that none of the information added after[apply()](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#apply())has been called will be available to consumers of metadata stored by the MediaMetadataEditor. <br />                                                                                                | | [MediaMetadataEditor](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor)! | [putString](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#putString(kotlin.Int,%20kotlin.String))`(`key:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Adds textual information. Note that none of the information added after[apply()](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#apply())has been called, will be available to consumers of metadata stored by the MediaMetadataEditor. <br />                                                                                                    | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                             | [removeEditableKeys](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#removeEditableKeys())`()` <br /> Causes all metadata fields to be read-only. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | ||

## Public methods

### apply

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun apply(): Unit
```

**Deprecated:** *Deprecated in Java.*

Applies all of the metadata changes that have been set since the MediaMetadataEditor instance was created with[RemoteController.editMetadata()](https://developer.android.com/reference/kotlin/android/media/RemoteController#editMetadata())or since[clear()](https://developer.android.com/reference/kotlin/android/media/MediaMetadataEditor#clear())was called.