this is the current state/situation: I have an Activity which binds a Service which creates AsyncTasks which downloads various web resources. That works well, but of course the ProgressBar shows nothing.
Previously i had an Activity which created an AsyncTask which downloaded some stuff. The AsyncTask got the View which holds the ProgressBar. So i could update the progress using onProgressUpdate and publishProgress. Obviously this doesn't work any longer because I have no reference to the ProgressBar.
So, do you have any idea on how to update the progress?
Thanks in advance.
Have the
Service
notify the then-runningActivity
about the progress fromonProgressUpdate()
. That could be via a broadcastIntent
, or via a callback object registered by theActivity
(and unregistered when theActivity
is destroyed, such as on a screen rotation).Very nice explained indeed just missing the example :) I went throw it and here it is.
You can show progress just as easily via a Toast, which obviates all of the UI concerns: