コンピューターに単語でいっぱいのテキスト ファイルを読み取らせ、それを ArrayList に追加しようとしています。通常の Java アプリケーションでは動作するようにしましたが、Android では動作しません。誰かが私を助けることができますか?
try {
FileInputStream textfl = (FileInputStream) getAssets().open("test.txt");
DataInputStream is = new DataInputStream(textfl);
BufferedReader r = new BufferedReader(new InputStreamReader(is));
String strLine;
while ((strLine = r.readLine()) != null) {
tots.add(strLine); //tots is the array list
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
エラーが発生し続けます。テキストファイルは 587kb ありますが、それで問題ないでしょうか?