Open szitguy opened 4 years ago
https://github.com/DB-BOY/FileChoose/blob/1125d8717bd2a616e9132d6272aa48c06cf569c8/app/src/main/java/cn/dbboy/filechoose/FileUtil.java#L109
改成:
File thirdPartyUriFile = getThirdPartyUriFile(uri); if (thirdPartyUriFile != null) { return thirdPartyUriFile.toString(); }
/** * 处理第三方文件管理器的文件Uri * * @param uri * * @return */ public static File getThirdPartyUriFile(Uri uri) { String path = uri.getPath(); if (!TextUtils.isEmpty(path)) { // 去掉第一个'/' path = path.substring(1); // 去掉新path第一个'/'前面的内容 path = path.substring(path.indexOf('/')); File file = new File(Environment.getExternalStorageDirectory(), path); if (file.exists()) { return file; } } return null; }
https://github.com/DB-BOY/FileChoose/blob/1125d8717bd2a616e9132d6272aa48c06cf569c8/app/src/main/java/cn/dbboy/filechoose/FileUtil.java#L109
改成: