在學習android 下載的部分時,由於當前使用的android版本較高,總是出現訪問權限問題---文件打開失敗。通過科學地上網終於找到解決辦法》》
Add android:requestLegacyExternalStorage="true" to the Android Manifest It's worked with Android 10 (Q) at SDK 29+
or After migrating Android X.
在AndroidMainfest.xml中添加android:requestLegacyExternalStorage="true"
1 <application 2 android:name=".MyApplication" 3 android:allowBackup="true" 4 android:hardwareAccelerated="true" 5 android:icon="" 6 android:label="" 7 android:largeHeap="true" 8 android:supportsRtl="" 9 android:theme="" 10 android:requestLegacyExternalStorage="true">
