I got stuck with an issue, that I can\'t seem to solve. When splitting I should be able to get id, name, check by setting row[0], row[1], row[2]. Strangely onl
Try this code,
ArrayList names = new ArrayList();
try {
DataInputStream dis = new DataInputStream(openFileInput(listLocation(listLoc)));
BufferedReader br = new BufferedReader(new InputStreamReader(dis));
String line;
while ((line = br.readLine()) != null) {
String[] row = line.split(",");
//names.add(row[0]); // id
names.add(row[1]); // name // ERROR AT THIS LINE
//names.add(row[2]); // check
}
br.close();
} catch (IOException e) {
e.printStackTrace();
}
I think you don't need to use Pattern.quote(",")
here.