getFileUriAboveApi30

@RequiresApi(value = 30)
open override fun getFileUriAboveApi30(file: File): Uri?

Get the uri by file.

getFileUriAboveApi30 will insert a new row into a table at the given URL Media.EXTERNAL_CONTENT_URI. So when you want to delete the image file, please also run android.content.ContentResolver.delete to make sure that the file-related information is completely deleted. For example:

contentResolver.delete(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
MediaStore.Images.Media.DISPLAY_NAME + "=?",
arrayOf("avatar.jpg")
)

By default, getFileUriAboveApi30 will only insertthe following columns: Media.DATA,Media.DISPLAY_NAME,Media.MIME_TYPE, If you want to customize, youcan refer to getFileUriAboveApi30 by using saveOptions parameter.

Since version 0.5.0, Media.DATE_ADDED will also be inserted as the default column.


@RequiresApi(value = 30)
open override fun getFileUriAboveApi30(saveOptions: MutableMap<String, String>.() -> Unit): Uri?

Get the uri by saveOptions.

getFileUriAboveApi30 will insert a new row into a table at the given URL Media.EXTERNAL_CONTENT_URI. So when you want to delete the image file, please also run android.content.ContentResolver.delete to make sure that the file-related information is completely deleted. For example:

contentResolver.delete(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
MediaStore.Images.Media.DISPLAY_NAME + "=?",
arrayOf("avatar.jpg")
)

Parameters

saveOptions

information about file.