Search code examples
androidnotificationsdownload-manager

Notification bar disappears after download is completed using DownloadManager in Android


i am downloading an application in Android using the DownloadManager class. When the download is completed, the notification bar disappears. How to let it visible until the user click on it?

EDIT

I can use VISIBILITY VISIBLE _NOTIFY COMPLETED in API level 11 and above, but I am using API level 10. What to do?


Solution

  • You can use:

    my_notification.flags |= Notification.FLAG_AUTO_CANCEL;
    

    Put the code above when creating a Notification.