我的 Android 项目的 Assets 文件夹中有一个名为 counter.txt
的文件。在运行时我想覆盖文件的内容。但它没有反射(reflect)。我该如何解决这个问题?
我使用了下面的代码。
String FILENAME = "counter.txt";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
最佳答案
据我所知,您不能在assets
文件夹中write/update
。您唯一能做的就是阅读
。
关于android - 覆盖Android项目 Assets 文件夹中文本文件的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9191273/