Reputation: 131
I'm trying for a while to make android read from a text file that I already have in the R.raw folder.
I have the function void readfile(Context context) that contains the line
InputStream is = context.getResources().openRawResource(R.raw.data);
However when I try to run the app it crashes at that exact line. Can you tell me a workaround? Or another way to read from that file?
Upvotes: 0
Views: 2651
Reputation: 4354
There is obviously a problem with the given context. You should post your logcat.
There is 2 ways to solve your problem.
Upvotes: 1