Search code examples
androidandroid-notificationsandroid-download-manager

DownloadManager setVisibleInDownloadsUi not working


I'm using DownloadManager in order to download and it is working great. However when I set setVisibleInDownloadsUi(false) the progress notification is still displayed.

Request request = new Request(Uri.parse(url));
request.setVisibleInDownloadsUi(false);
mDownloadManager.enqueue(request);

In my Manifest I've added the following permissions:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />

Solution

  • The Notification is controlled via setNotificationVisibility(), not setVisibleInDownloadsUi()`, according to the documentation.