Partager via


MediaStore.Audio.Genres.Members.InterfaceConsts.GenerationModified Field

Definition

Generation number at which metadata for this media item was last changed.

[Android.Runtime.Register("GENERATION_MODIFIED", ApiSince=30)]
public const string GenerationModified;
[<Android.Runtime.Register("GENERATION_MODIFIED", ApiSince=30)>]
val mutable GenerationModified : string

Field Value

Attributes

Remarks

Generation number at which metadata for this media item was last changed. This is useful for apps that are attempting to quickly identify exactly which media items have changed since a previous point in time. Generation numbers are monotonically increasing over time, and can be safely arithmetically compared.

Detecting media changes using generation numbers is more robust than using #DATE_MODIFIED, since those values may change in unexpected ways when apps use File#setLastModified(long) or when the system clock is set incorrectly.

Note that before comparing these detailed generation values, you should first confirm that the overall version hasn't changed by checking MediaStore#getVersion(Context, String), since that indicates when a more radical change has occurred. If the overall version changes, you should assume that generation numbers have been reset and perform a full synchronization pass.

Java documentation for android.provider.MediaStore.MediaColumns.GENERATION_MODIFIED.

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