I've read about one trillion answers to this question that don't involve using a vector of strings.
private Vector<String> getLetters(String chapter, int t) throws IOException {
InputStream is = getResources().openRawResource(com.example.android.myprojecte.R.raw.aa);
Vector<String> letters = null;
InputStreamReader isReaded = new InputStreamReader(is);
BufferedReader reader = new BufferedReader(isReaded);
String line = null;
while ((line = reader.readLine()) != null) {
letters.add(line);
}
return letters;
}
Basically, I just need to read a text file into a vector string, but my emulator keeps crashing. It could be something with my fragments, but the error code is signifying it's an I/O problem? So is this wrong above please and thank you
0 comments:
Post a Comment