getFileUriAboveApi30
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.
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
information about file.