How to use MediaStore to save picture under Android Q(10)?

Viewed 79
val newImageDetail = ContentValues().apply {
    put(MediaStore.Images.Media.DISPLAY_NAME, fileName)
    put(MediaStore.Images.Media.RELATIVE_PATH,
            ${Environment.DIRECTORY_PICTURES}${File.separator}$folderName"
        )
}
val uri =contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, newImageDetail)

this code can work in Android Q, but how to save picture under Android Q?

0 Answers
Related