This is my solution: https://github.com/Gotchamoh/Android-AsyncTask-ProgressDialog
Basically the steps are:
- I use
onSaveInstanceState
to save the task if it is stillprocessing. - In
onCreate
I get the task if it was saved. - In
onPause
I discard theProgressDialog
if it is shown. - In
onResume
I show theProgressDialog
if the task is stillprocessing.