Wednesday, 28 November 2018

Download Manager returns unsuccessful download on Android 9.0

I am using Download Manager to download file from the internet. The download complete successfully in Android 6, 8.1, but not in Android 9.0

DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setDescription("Downloading...");
request.setTitle(nameOfFile);
request.setMimeType("application/pdf");
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS + "/CPG", nameOfFile);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
queueId = manager.enqueue(request);



from Download Manager returns unsuccessful download on Android 9.0

No comments:

Post a Comment