如果File的路徑是("/sdcard/XXXX");
在AndroidManifest.xml里添加requestLegacyExternalStorag文章來源:http://www.zghlxwxcb.cn/news/detail-847088.html
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Test"
tools:targetApi="31">
requestLegacyExternalStorag具體什么意思自己去搜文章來源地址http://www.zghlxwxcb.cn/news/detail-847088.html
到了這里,關(guān)于Android “sdcard“ File.mkdirs()失敗解決辦法的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!