I need to read a dict.txt file that contains one line for a line and add them to arraylist.
I tried this:
public ArrayList<String> myDict = new ArrayList<String>(); InputStream is = (getResources().openRawResource(R.raw.dict)); BufferedReader r = new BufferedReader(new InputStreamReader(is)); try { while (r.readLine() != null) { myDict.add(r.readLine()); } } catch (IOException e) {
but something is wrong ...
source share