From ff6c9fc6ba5b767f778b33b3f1881dd0bcce6a0c Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 30 Oct 2019 16:24:42 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/utils/FileUtils.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/utils/FileUtils.kt b/app/src/main/java/io/legado/app/utils/FileUtils.kt index 239b046d1..39148fe76 100644 --- a/app/src/main/java/io/legado/app/utils/FileUtils.kt +++ b/app/src/main/java/io/legado/app/utils/FileUtils.kt @@ -92,7 +92,7 @@ object FileUtils { // ExternalStorageProvider if (isExternalStorageDocument(uri)) { val docId = DocumentsContract.getDocumentId(uri) - val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() + val split = docId.split(":") val type = split[0] if ("primary".equals(type, ignoreCase = true)) { @@ -101,7 +101,7 @@ object FileUtils { } else if (isDownloadsDocument(uri)) { val id = DocumentsContract.getDocumentId(uri) - val split = id.split(":").dropLastWhile { it.isEmpty() }.toTypedArray() + val split = id.split(":") val type = split[0] if ("raw".equals(type, ignoreCase = true)) { //处理某些机型(比如Google Pixel )ID是raw:/storage/emulated/0/Download/c20f8664da05ab6b4644913048ea8c83.mp4 @@ -115,7 +115,7 @@ object FileUtils { return getDataColumn(context, contentUri, null, null) } else if (isMediaDocument(uri)) { val docId = DocumentsContract.getDocumentId(uri) - val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() + val split = docId.split(":".toRegex()) val contentUri: Uri = when (split[0]) { "image" -> MediaStore.Images.Media.EXTERNAL_CONTENT_URI