且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android - 只读文件系统 IOException

更新时间:2022-12-16 18:07:25

因为你正在尝试将文件写入root,所以你需要将文件路径传递给你的文件目录.

Because you are trying to write the file to root, you need to pass the file path to your file directory.

例子

String filePath = context.getFilesDir().getPath().toString() + "/fileName.txt";
File f = new File(filePath);