I am downloading a file from url using Download Manager. And the file is downloaded successfully.
The problem
File is downloading silently, no notification in the notification area.
The download manager showed notification (with progressbar) on my device running on android 6.0. After i have updated my device to android 7.0 the download manager doesn't show any notification on the notification area.
Here is my code
Uri uri = Uri.parse("file://" + destination);
url = "http:....."; //Valid File URL
//Set up download manager request
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setDescription("Downloading " + file_name);
request.setTitle("My Downloader");
request.setDestinationUri(uri); //URI is valid
//Start the download
DownloadManager manager = (DownloadManager) getContext()
.getSystemService(Context.DOWNLOAD_SERVICE);
Also adding request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE);
is not helping my case.
Build Information
Here is my Gradle Build infformation.
minSdkVersion 22
targetSdkVersion 23
compileSdkVersion 25
buildToolsVersion "25.0.2"
I was facing a similar problem that the file was downloading successfully but the progress was not visible in the notification area.
The issue was with notification visibility. Following line helped me solve it:
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With