简体   繁体   中英

How to save back into a file in assets folder

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

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

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

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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM