Tae-Sung Shin
Tae-Sung Shin

Reputation: 20643

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?

Upvotes: 5

Views: 10987

Answers (1)

user370305
user370305

Reputation: 109237

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?

Upvotes: 18

Related Questions