I am trying to access a file /mnt/sdcard/test.txt
in Android App through Java code File file = new File(path + "/test.txt");
. When I check file existence through file.exists()
, it returns false in Android 11. But the same source code works fine till Android 10.
In AndroidManisfest.xml I have given all below permissions:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:requestLegacyExternalStorage="true">
question from:
https://stackoverflow.com/questions/65856330/android-11-file-read-write-permission-issue-in-java-code 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…