报错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 );