提交 f9dc1ec6 编写于 作者: C caoshen

修复从SAF选择文件时id解析异常的问题

上级 3befa9bc
......@@ -177,13 +177,15 @@ public final class UriUtils {
return null;
}// end 1_0
else if ("com.android.providers.downloads.documents".equals(authority)) {
final String id = DocumentsContract.getDocumentId(uri);
String id = DocumentsContract.getDocumentId(uri);
if (TextUtils.isEmpty(id)) {
Log.d("UriUtils", uri.toString() + " parse failed(id is null). -> 1_1");
return null;
}
if (id.startsWith("raw:")) {
return new File(id.substring(4));
} else if (id.startsWith("msf:")) {
id = id.split(":")[1];
}
String[] contentUriPrefixesToTry = new String[]{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册