Check for file existence in androids assets folder?

前端 未结 6 1251
不思量自难忘°
不思量自难忘° 2020-12-30 19:33

My app has .txt files in subdirectories in the assets folder. It reads those .txt files and puts them in a textview. It\'s working great and no problems.

Should I be

6条回答
  •  感情败类
    2020-12-30 20:09

    Yes and No.

    A normal user would not be able to delete them, but a user on a rooted phone who doesn't know what they're doing… that's a different situation.

    If you ask me, the extra code is not needed. Also if you try and open a file that doesn't exist, you will get an exception thrown at some point, catch that and display a dialog if you really want to.

提交回复
热议问题