问题
I'm using DownloadManager to download files. I know how to download one file and either use
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
or not. But I have multiple files that "belong" together in a sense, so I'd like to have a "queue" for those, and display the notification in a way that it shows the progress of the "queue" (let's say I added 5 files to the queue, so it would show 20% after the 1st file is downloaded, 40% after 2 of them,...)
The order of the files is not important, but I would like to be able to detect in the BroadcastReceiver's onReceive() function when the last file of the queue is downloaded.
So far the closest I managed to do was not to use the request.setNotificationVisibility, count the downloaded files by matching the downloadId in onReceive() and do what I need to do when the last file is downloaded.
Is there a way to do it more "visible"?
来源:https://stackoverflow.com/questions/15053740/how-to-download-multiple-files-with-android-downloadmanager-so-that-it-appears-i