【发布时间】:2015-04-01 16:17:08
【问题描述】:
final String rootPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Slots/";
final File file = new File(rootPath);
file.mkdirs();
final File sdFile = new File(file, "Profile.txt");
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(sdFile));
bw.write(edit.getText().toString() + "\n");
bw.write("5000");
} catch (IOException e) {
}
在此代码中捕获 IOException,但创建了文件。请帮忙!谢谢大家的回答。
【问题讨论】:
-
那么异常说明了什么?文件里有什么?
-
请多解释,并尝试用代码示例写一个更清晰的问题