I started targeting Android 13 with API 33. The app is requesting Manifest.permission.READ_EXTERNAL_STORAGE
for the older APIs. Now I know that I have to request the new permissions: READ_MEDIA_IMAGES
and READ_MEDIA_VIDEO
.
I have added in the manifest:
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
and now, as a result, in the setting of the permissions for the app I see an extra option to enable these permissions.
What I can't do is to ask the permission at runtime
If I try to access Manifest.permission.READ_MEDIA_IMAGES
in the code I get unresolved reference
so I can't dynamically request the permission and if I don't then the user needs to do it manually.
How to handle the READ_MEDIA_IMAGES
and READ_MEDIA_VIDEO
?
targetSdk
to get the runtime permission prompt displayed, even though I had denied the old permission. Note: I didn't have "Unresolved reference", just the permission prompt problem. – Limbic