Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
256 views
in Technique[技术] by (71.8m points)

Android 11 File Read/Write Permission issue in Java Code

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...