I have searched through the net to find this answer. But no result found. Sorry that I'm a very newbie in Java & Android programming.
I would elaborate on my question more. Let say my Activity started an IntentService and it's running independently in the background. The service is "subscribed" to the callback of ResultReceiver to update the Activity UI. And during the service is executing the long running process, the Activity is destroyed. So what will happen if the service send a reply or progress update to the Activity via the ResultReceiver ?
Cause as I know, the ResultReceiver need to have a reference of the Activity.
In my project I'm required to develop an video clip messaging app. Which when user captured the video, it will pass the data to the service and the service will perform uploading as well as saving some info into db.. while keep posting the progress update to the Activity UI via ResultReceiver.
User is able to quit or kill the Activity as they like. But when they navigate back to the app/Activity, if the upload/download is still ongoing, it need to show the current progress..
Initially I think of Asynctask, but it's also having similar problem as I mentioned. It need a reference of the caller Activity.
Is there anywhere that I can achieve the requirement I mentioned ? Sorry for the long post. Hope someone can enlighten me a bit and it's even better to have some code snippet. Thanks a lot :)
Edit: In short, is there a way to dynamically bind a newly created Activity to a running IntentService so that the service can send the progress update to the correct Activity ?