I am using IntentService, ResultReceiver mechanism for a long running task and showing progress dialog in my activity during the IntentService run. As the task completes in intentService, I send appropriate resultCode to the Activity in onReceiveResult and dismiss the progress dialog accordingly. Everything works fine except when the device orientation is changed, during which the application crashes as the activity destroys and the Intent service tries to send the resultCode to the destroyed activity.
I don not want to stop the system to recreate my Activity on screen rotation.
How to handle this?