Android 11 cannot retrieve files create with MediaStore after the app re-installs
Asked Answered
H

1

3

In Android 11 targeting SDK 30, the files created into the shared folder with MediaStore are not retrieved when the app is reinstalled.

Heehaw answered 11/5, 2021 at 13:38 Comment(8)
That is expected behavior. What is your question?Calix
What do you consider to be 'the shared folder'?Accrue
@Calix I don't know if this behaviour should be considered the one expected because the owner of the file should be able to read the file createdHeehaw
@Accrue the shared folder are Documents, Download, PicturesHeehaw
What do you mean with 'not retrieved'? I think they are still there.Accrue
@Accrue Yes, they are still there, but when I query the MediaStore with contentResolver query they are not retrievedHeehaw
That is normal on an Android 10 device as you will see only apps own files and some public media files. The owner is very important on Android 11 and at reinstall the app is not the owner anymore. If you want to use them again use saf.Accrue
"I don't know if this behaviour should be considered the one expected because the owner of the file should be able to read the file created" -- the owner of the file was uninstalled. From Android's standpoint, your fresh app install is not the owner.Calix
G
0

@Davide Murru, With shared folders as Pictures, Movies & Music, you can! I checked this on an Android 13. Even after a reinstall, I find them.

But don't miss to authorize respectively READ_MEDIA_IMAGES, READ_MEDIA_VIDEO & READ_MEDIA_AUDIO permissions for each folders you use.

Gourley answered 14/2 at 16:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.