我从开发者页面复制了一个示例:
String FILENAME = "hello_file";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
但它说:
异常java.io.filenotfoundexception on: openFileOutput(FILENAME,Context.MODE_PRIVATE)
答案 0 :(得分:0)
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
在清单
中更多信息:http://developer.android.com/guide/topics/security/permissions.html