How to write in a file declared in res/raw?

前端 未结 2 1481
自闭症患者
自闭症患者 2021-01-23 16:52

I have a file stored in res/raw, and I would like to know how to wite into that file. I tried getResources but it returns an inputStream.

2条回答
  •  攒了一身酷
    2021-01-23 17:07

    You shouldn't be writing your application resources. Instead, try copying the resource to your writable data directory and modifying it there. There a number of methods on Context that will help you find an appropriate directory, depending on your needs.

提交回复
热议问题