From 1a6f85214fe74ed2afeed93dde37684701e60b87 Mon Sep 17 00:00:00 2001 From: "I3130002-PC\\i3130002" Date: Thu, 31 May 2018 03:24:06 +0430 Subject: [PATCH 1/3] Please consider this push as an answer to https://github.com/iPaulPro/aFileChooser/issues/99 --- .../src/com/ipaulpro/afilechooser/utils/FileUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java b/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java index 25c8008..b0f0a08 100644 --- a/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java +++ b/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java @@ -290,7 +290,8 @@ else if (isExternalStorageDocument(uri)) { } // DownloadsProvider else if (isDownloadsDocument(uri)) { - + if (id.startsWith("raw:")) + filePath= id.replaceFirst("raw:", ""); final String id = DocumentsContract.getDocumentId(uri); final Uri contentUri = ContentUris.withAppendedId( Uri.parse("content://downloads/public_downloads"), Long.valueOf(id)); From 06401ca420d30bf4d0c68eba7a6d930eb51aa304 Mon Sep 17 00:00:00 2001 From: "I3130002-PC\\i3130002" Date: Thu, 31 May 2018 03:50:11 +0430 Subject: [PATCH 2/3] Fix typo --- .../src/com/ipaulpro/afilechooser/utils/FileUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java b/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java index b0f0a08..491ef9b 100644 --- a/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java +++ b/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java @@ -290,8 +290,8 @@ else if (isExternalStorageDocument(uri)) { } // DownloadsProvider else if (isDownloadsDocument(uri)) { - if (id.startsWith("raw:")) - filePath= id.replaceFirst("raw:", ""); + if (uri.toString().startsWith("raw:")) + filePath= uri.replaceFirst("raw:", ""); final String id = DocumentsContract.getDocumentId(uri); final Uri contentUri = ContentUris.withAppendedId( Uri.parse("content://downloads/public_downloads"), Long.valueOf(id)); From a502f8b3d58cc65217342a8847fd3b8df35f912f Mon Sep 17 00:00:00 2001 From: "I3130002-PC\\i3130002" Date: Thu, 31 May 2018 03:55:21 +0430 Subject: [PATCH 3/3] you can blame me --- aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java b/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java index 491ef9b..a8f0915 100644 --- a/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java +++ b/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java @@ -291,7 +291,7 @@ else if (isExternalStorageDocument(uri)) { // DownloadsProvider else if (isDownloadsDocument(uri)) { if (uri.toString().startsWith("raw:")) - filePath= uri.replaceFirst("raw:", ""); + filePath= uri.toString().replaceFirst("raw:", ""); final String id = DocumentsContract.getDocumentId(uri); final Uri contentUri = ContentUris.withAppendedId( Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));