"Activity A" send url and file name to DownloadManager that start download
DownloadManager
should be a Service
because you want it to work in a background and not interact with UI changes such as screen rotation and so on. Implement your own threading inside this Service
as you need.
I recommend ThreadPoolExecutor
. It will allow you to set the number of threads, so you will be able to switch execution from serial to parallel and so on.
and show progress in notification
Use startForeground
method call for that. Refer http://developer.android.com/reference/android/app/Service.html
when progress notification is clicked open "Activity B" with list of downloads with all downloads in progress and finished.
Use PendingIntent
for that because notifications run in a system process, not in you application process. PendingIntent
will give you permissions to open ActivityB
. Refer: Open application after clicking on Notification
If you want to show the status of operations in your ActivityB
you can easily bind
to your DownloadManager
and update activity UI via callback from progress updates.