Quantcast
Channel: Background task, progress dialog, orientation change - is there any 100% working solution? - Stack Overflow
Viewing all articles
Browse latest Browse all 9

Answer by SMBiggs for Background task, progress dialog, orientation change - is there any 100% working solution?

$
0
0

While Mark's (CommonsWare) answer does indeed work for orientation changes, it fails if the Activity is destroyed directly (like in the case of a phone call).

You can handle the orientation changes AND the rare destroyed Activity events by using an Application object to reference your ASyncTask.

There's an excellent explanation of the problem and the solution here:

Credit goes completely to Ryan for figuring this one out.


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>