我在Android的Assets文件夹中使用了文本文件。我想动态更改该文本文件中的数据。我正在尝试按以下方式打开文件:
FileOutputStream fos=this.getAssets().openNonAssetFd("data.txt").createOutputStream();
但这会产生错误:
java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
。请帮助我编辑此文件。非常感谢你。 最佳答案
在运行时写入/assets
目录?无法使用AFAIK。
您可以将原始文件放入/assets
中,并在第一个应用程序运行时将其复制到/sdcard
中。