I have an Activity that pops up an AlertDialog under certain circumstances.
However, if you rotate the device, the Activity gets destroyed and recreated and the AlertDialog is gone.
How are people handling this?
It would be easy enough to save some flag to savedInstanceState letting the Activity know to throw the AlertDialog again upon creation, but what if your AlertDialog needs lots of data and that data is dynamic? That's going to get ugly really fast.
Especially in my case:
When my app wants to make a web service call, it boots up an IntentService, passes an Intent with the necessary data (credentials and data to send to the web service) and starts. If the Intent being processed by the IntentService fails due to a log in error, it broadcasts a message which my Activities will hear. I've extended Activity and ListActivity and added a BroadcastReceiver to them. My app's Activities extend from these. They then pop up an AlertDialog requesting the user's credentials. The original Intent's extras also get passed along so, after a successful login, it can get re-processed. Unfortunately, when the user changes the screen orientation (for example, by pulling out the hardware keyboard) the AlertDialog is going to disappear.