Andriod 写入存储问题

阅读 30

2022-01-16

报错1:写入文件时报错他:Permission denied

原因:没有权限

在AndroidManifest.xml文件中声明权限

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

报错2:Read-only file system

原因:当前文件夹没有写入权限。

解决:更改其他文件夹。

String filePath = context.getFilesDir().getPath().toString()+"/xxx.txt";
System.out.println( filePath );

精彩评论(0)

0 0 举报