我面对一个奇怪的场景,当我从应用程序link_for_image打开intent时,我有5张图像,因为除了能够圈出的剩余图像,我能够获得路径,但上面链接中提到的已圈出的图像却出现了以下错误,
java.io.FileNotFoundException: /storage/emulated/0/Download/edcd36b47bdf6e9e045c72250a8bbd24.jpg
在下载文件夹中(从文件管理器打开时,带圆圈的图像不可用,可能是问题所在,这是检索图像路径的逻辑)>
String fileName = getFilePath(context, uri);
if (fileName != null) {
return Environment.getExternalStorageDirectory().toString() + "/Download/" + fileName;
}
String id = DocumentsContract.getDocumentId(uri);
if (id.startsWith("raw:")) {
id = id.replaceFirst("raw:", "");
File file = new File(id);
if (file.exists())
return id;
}
final Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
return getDataColumn(context, contentUri, null, null);
我面对一个奇怪的场景,当我从应用程序link_for_image打开intent时,我有5张图像,因为除了圈出的图像剩余图像,我都能获得路径,我的错误率低于... ...
mediascanner
不知道它。