muzei-api / com.google.android.apps.muzei.api.provider / Artwork / Builder / persistentUri

persistentUri

fun persistentUri(persistentUri: Uri?): Builder

Sets the artwork's persistent URI, which must resolve to a JPEG or PNG image, ideally under 5MB.

When a persistent URI is present, your MuzeiArtProvider will store downloaded images in the cache directory and automatically re-download the image as needed. If it is not present, then you must write the image directly to the MuzeiArtProvider with ContentResolver.openOutputStream and the images will be stored in the Context.getFilesDir as it assumed that there is no way to re-download the artwork.

Parameters

persistentUri - the artwork's persistent URI. Your app should have long-lived access to this URI.

Return
this Builder.

See Also

MuzeiArtProvider.openFile