【发布时间】:2014-11-30 08:35:37
【问题描述】:
我的 Android 项目的 assets 文件夹中有一个名为 counter.txt 的文件。在运行时我想覆盖文件的内容。但这不是反映。我该如何解决这个问题?
我使用了下面的代码。
String FILENAME = "counter.txt";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
【问题讨论】: