我在Android的assets文件夹中使用了一个文本文件.我想动态更改该文本文件中的数据.我试图打开文件如下:
FileOutputStream fos=this.getAssets().openNonAssetFd("data.txt").createOutputStream();
Run Code Online (Sandbox Code Playgroud)
但它产生了错误:java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed.请帮我编辑这个文件.非常感谢你.
rac*_*ack 13
/assets在运行时写入目录?AFAIK是不可能的.
您可以将原始文件放入/assets,并在第一个应用程序运行时将其复制到/sdcard.
| 归档时间: |
|
| 查看次数: |
9319 次 |
| 最近记录: |