如何保存回的资产文件夹中的文件 [英] How to save back into a file in assets folder

查看:102
本文介绍了如何保存回的资产文件夹中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我明白我可以打开的资产文件夹中的文件是这样的。

I understand I can open a file in assets folder like this.

InputStream is = ((Activity) mView).getAssets().open("some.txt");

不过,我应该怎么做才能挽救回同一个文件?我的意思是我怎么同一个文件中的OutputStream?

But what should I do to save back to the same file? I mean how do I get OutputStream of the same file?

推荐答案

根据我所知的不能,因为 /资产目录不写的,所以你不能对文件,该文件位于/资产目录中的任何变化,它由于Android的.apk文件只可读。

As per my knowledge you can't because /asset directory is not writeable, So you can't make any changes on file which are in /asset directory, Its because Android .apk file is only readable.

有关更多信息看这个讨论<一个href="http://groups.google.com/group/android-developers/browse_thread/thread/17085e83146e47d0#">Writing到文件夹的资产与这太问题<一href="http://stackoverflow.com/questions/3760626/how-to-write-files-to-assets-folder-or-raw-folder-in-android">How将文件写入到资产的文件夹或原始文件夹中的android?

For more info look at this discussion Writing to file Assets folder And this SO question How to write files to assets folder or raw folder in android?

这篇关于如何保存回的资产文件夹中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆