다음을 통해 공유


MediaStore.DownloadColumns.GenerationAdded Field

Definition

Caution

Use 'Android.Provider.MediaStore.IMediaColumns.GenerationAdded'. This class will be removed in a future release.

Generation number at which metadata for this media item was first inserted.

[Android.Runtime.Register("GENERATION_ADDED", ApiSince=30)]
[System.Obsolete("Use 'Android.Provider.MediaStore.IMediaColumns.GenerationAdded'. This class will be removed in a future release.")]
public const string GenerationAdded;
[<Android.Runtime.Register("GENERATION_ADDED", ApiSince=30)>]
[<System.Obsolete("Use 'Android.Provider.MediaStore.IMediaColumns.GenerationAdded'. This class will be removed in a future release.")>]
val mutable GenerationAdded : string

Field Value

Attributes

Remarks

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

Detecting media additions using generation numbers is more robust than using #DATE_ADDED, 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_ADDED.

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