【发布时间】:2017-10-13 21:06:59
【问题描述】:
对于手机内存中存在的文件,路径为/system/data/recf/pic.jpg,使用openInputStream()方法构造inputStream会抛出FileNotFoundException。
这就是我正在做的-
ContentResolver cr = context.getContentResolver();
InputStream inputStream = null;
Uri filename = Uri.parse("file:///system/data/recf/pic.jpg");
inputStream = cr.openInputStream(filename);
但它正在抛出 FileNotFoundException。我已检查该文件是否存在。卡了很久,求大神帮忙。谢谢。
【问题讨论】:
-
您正在测试什么操作系统版本?检查 FileProvider 文档
-
操作系统版本为android 6.0.1。它显示的错误消息是这样的 - java.io.FileNotFoundException: /system/data/recf/pic.jpg: open failed: ENOENT (No such file or directory)
标签: android uri inputstream android-contentresolver