How to read a local (res/raw) file line by line?

前端 未结 2 750
清歌不尽
清歌不尽 2020-12-21 14:06

I have a text file in my res/raw directory. I want to read the file line by line, but FileReader and BufferedReader fail, because of Android\'s security restriction. How els

2条回答
  •  一个人的身影
    2020-12-21 15:01

    getResources().openRawResource() returns an InputStream that should be usable for line-by-line reading.

提交回复
热议问题