Android – Read Only File System IOException

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 = new File(filePath);

Leave a Comment