diff --git a/src/android/FileHelper.java b/src/android/FileHelper.java index ccc5e3e..edf1657 100644 --- a/src/android/FileHelper.java +++ b/src/android/FileHelper.java @@ -97,10 +97,21 @@ public class FileHelper { else if (isDownloadsDocument(uri)) { final String id = DocumentsContract.getDocumentId(uri); - final Uri contentUri = ContentUris.withAppendedId( - Uri.parse("content://downloads/public_downloads"), Long.valueOf(id)); + if (id != null && id.length() > 0) { + if (id.startsWith("raw:")) { + return id.replaceFirst("raw:", ""); + } + try { + final Uri contentUri = ContentUris.withAppendedId( + Uri.parse("content://downloads/public_downloads"), Long.valueOf(id)); - return getDataColumn(context, contentUri, null, null); + return getDataColumn(context, contentUri, null, null); + } catch (NumberFormatException e) { + return null; + } + } else { + return null; + } } // MediaProvider else if (isMediaDocument(uri)) {