Partager via


CloudMediaProviderContract.MediaCollectionInfo.MediaCollectionId Field

Definition

Media collection identifier

[Android.Runtime.Register("MEDIA_COLLECTION_ID", ApiSince=33)]
public const string MediaCollectionId;
[<Android.Runtime.Register("MEDIA_COLLECTION_ID", ApiSince=33)>]
val mutable MediaCollectionId : string

Field Value

Attributes

Remarks

Media collection identifier

The only requirement on the collection ID is uniqueness on a device.

This value will not be interpreted by the OS, however it will be used to check the validity of cached data and URI grants to client apps. Anytime the media or album ids get re-indexed, a new collection with a new and unique id should be created so that the OS can clear its cache and more importantly, revoke any URI grants to apps.

Apps are recommended to generate unique collection ids with, UUID#randomUUID. This is preferred to using a simple monotonic sequence because the provider data could get cleared and it might have to re-index media items on the device without any history of its last ID. With random UUIDs, if data gets cleared, a new one can easily be generated safely.

Type: STRING

Java documentation for android.provider.CloudMediaProviderContract.MediaCollectionInfo.MEDIA_COLLECTION_ID.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to