1
votes

I've found through research on google that that I can read a text file by storing it in my res/raw folder and then accessing it through getResources().openRawResource(R.raw.words);

In a class WordHelper I the constructor provides throws an InvocationException on this line of code:

istream = getResources().openRawResource(R.raw.words);

Which is the one most examples seem to use without a problem, I will then go on to do this isreader = new InputStreamReader(istream); myReader = new BufferedReader(isreader); once everything is working and then use the readLine() method.

All descriptions of InvocationException such as getCause are null, I definately have the file in the res/raw/words.txt.

Thanks for reading.

1

1 Answers

1
votes

I got the same problem and solved it using isreader = new InputStreamReader(istream, "UTF8");