与此下面的代码我试图访问其存储在asset/raw
文件夹文件,但我得到null
和Android开文件/生
E/ERR: file:/android_asset/raw/default_book.txt (No such file or directory)
错误,我的代码是:
private void implementingDefaultBook() {
String filePath = Uri.parse("file:///android_asset/raw/default_book.txt").toString();
File file = new File(filePath);
try {
FileInputStream stream = new FileInputStream(file);
} catch (Exception e) {
e.printStackTrace();
Log.e("ERR ", e.getMessage());
} catch (OutOfMemoryError e) {
e.printStackTrace();
}
}
我希望帮你。 Plz接受答案并加入它。谢谢 :) –