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 music file, please also run android.content.ContentResolver.delete to make sure that the file-related information is completely deleted. For example:
contentResolver.delete(
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
MediaStore.Audio.Media.DISPLAY_NAME + "=?",
arrayOf("xxx.mp3")
)
By default, getFileUriAboveApi30 will only insert the following columns: Media.DATA, Media.DISPLAY_NAME, Media.MIME_TYPE, If you want to customize, you can refer to getFileUriAboveApi30 by using saveOptions parameter.
Since version 0.5.0, Media.DATE_ADDED will also be inserted as a 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.Audio.Media.EXTERNAL_CONTENT_URI,
MediaStore.Audio.Media.DISPLAY_NAME + "=?",
arrayOf("xxx.mp3")
)
Parameters
information about file.