How to Download base64 image using DownloadManager (I mean image must to show in application Downloads after download(convert base64 to bytes and save in file) )
For example:
I need load image from my custom browser from next html "<img src=\"data:image/jpeg;base64,someBase64String" />"
. And load it exactly same(for user opinion) as a normal image url. For normal image url I use DownloadManager:
DownloadManager.Request request = new DownloadManager.Request(source);
request.allowScanningByMediaScanner();
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName);
request.setTitle(fileName);
request.setDescription(fileName);
DownloadManager dm = (DownloadManager) App.getInstance().getSystemService(Context.DOWNLOAD_SERVICE);
dm.enqueue(request);