//Find number of lines in txt file
int numLine=0;
String line = null;
while ((line = buf.readLine()) != null) {
numLine++;
}
You don't need the number of lines in the file. Remove all that.
//write data from txt file to ArrayList temp
for (int i = 0; i < numLine; i++) {
temp.add(buf.readLine());
}
Change that to
String line;
while ((line = buf.readLine()) != null)
{
temp.add(line);
}