![](/img/trans.png)
[英]Where is this “text.txt” file stored?How would I change where the file is saved to and view the contents?
[英]Where is the saved file is stored ? in Android
我使用了这段代码,但是在任何地方都找不到保存的文件!
String filename = "fichier";
String string = "bonjour";
FileOutputStream outputStream;
try {
outputStream = openFileOutput(filename, Context.MODE_PRIVATE);
outputStream.write(string.getBytes());
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
如果使用与outputStream相同的参数打开一个新的fileInputStream,则可以找到它。 您可能还需要考虑将SharedPreferences用于存储一个String这样简单的事情。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.