File external = getExternalFilesDir(null);
//fd is stringbuffer whose value is "year1:semester:2"
File file = new File(external,""+fd.toString()+".txt"); // <----error
FileOutputStream fos = new FileOutputStream(file);
fos.write(store.getBytes());
fos.close();这是生成的异常:
W/System.err(29169): java.io.FileNotFoundException: /storage/sdcard0/Android/data/com.example.ddu/files/Year:1Semester:2.txt: open failed: EINVAL (Invalid argument)发布于 2014-05-30 18:22:26
不能创建具有冒号()的文件。用其他的东西替换冒号。
https://stackoverflow.com/questions/23960885
复制相似问题