I have an activity with a "download" button which fires up DownloadManager implemented in an IntentService. Everything is working just fine and my question is:
Is it possible to display ProgressBar or ProgressDialog from my DownloadService (which is extended IntentService), except the progress shown in the Notification bar?
Could you write a sample code or pseudo code how I can do that? Thank you
You can use ResultReceiver to reach your goal. ResultReceiver implements Parcelable so you are able to pass it into IntentService like:
Then in your onHandlerIntent() all what you need is to obtain receiver you passed into Intent and send current progress into ResultReceiver:
And ResultReceiver will handle data and will make update in ProgressDialog. Here is implementation of ResultReceiver (make it as inner class of your Activity class):