Android - Read Only File System IOException-目录问题

调用android的保存文件功能,出现android java.io.IOException: open failed: EROFS (Read-only file system)

解决方法:

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

Example

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

猜你喜欢

转载自wmcxy.iteye.com/blog/1847145