- In an activity A I download several files from the server to my device.
-
A progressBar shows the progress of the current download.
-
I can do multiple downloads at once and I want an activity B shows a list of all my downloads with progressBar for each download.
-The problem is that I do not really know how to share the progress of each download to activity B when I start it via a menu.
Set up a downloading
Serviceinstead of just using anAsyncTaskto fetch your files. Then, anyActivitythat’s interested in the progress of said downloads can bind theServiceand register a listener for progress updates which are then reflected in whatever UI is appropriate to the respectiveActivitys.