你知道为什么它不认识我的道路吗?
Uri path = Uri.fromFile(new File("assets/test.xml")); // tried with "file:///android_asset/test.xml"
String fileIn = path.getPath();
FileInputStream fis = new FileInputStream(fileIn);
我在结尾处得到一个FileNotFound错误,即fis变量。
非常感谢。
答案 0 :(得分:0)
getAssets()将返回资产文件夹。您可以通过
读取文件InputStream in = getAssets().open("test.xml");
如果你这样做我们的活动。然后你需要调用context.getAssets();