Android 9 and above, loading images in Downloads folder causes IllegalArgumentException and fails.
In Utils.java, getDataColumn method below fails.
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
final String id = DocumentsContract.getDocumentId(uri);
// String "id" may not represent a valid Long type data, it may equals to
// something like "raw:/storage/emulated/0/Download/some_file" instead.
// Doing a check before passing the "id" to Long.valueOf(String) would be much safer.
if (RawDocumentsHelper.isRawDocId(id)) {
filePath = RawDocumentsHelper.getAbsoluteFilePath(id);
} else {
final Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
filePath = getDataColumn(context, contentUri, null, null);
}
}
I received the following message:
java.lang.IllegalArgumentException: Unknown URI: content://downloads/public_downloads/5
Android 9 and above, loading images in Downloads folder causes IllegalArgumentException and fails. In Utils.java, getDataColumn method below fails.
I received the following message:
java.lang.IllegalArgumentException: Unknown URI: content://downloads/public_downloads/5
Any solution / guidance would be appreciated.