I read the documentation and also searched for a potential solution. However, it's still not clear how to deal with. In my project, I used these permission lines in the app's AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
to give corresponding accesses. Also, I handle those permissions in onRequestPermissionsResult()
to ensure that the user allows them. However, recently I go this warinig
WRITE_EXTERNAL_STORAGE no longer provides write access when targeting Android 10, unless you use requestLegacyExternalStorage
My app supports Android versions 21+ and seemly Android 10 and above versions do not require above mentioned permissions.
How can I deal with the requestLegacyExternalStorage
and android.permission.WRITE_EXTERNAL_STORAGE />
to keep functionable for all supported Android versions (21 and above)?