It's pretty common for my app to show a progress or AlertDialog
to the user. If the user puts the app into the background and then returns later, I want the Dialog
to still be shown. Is there a way to make Android handle this? I'd like it to either not close the dialog, or if it does reopen it automatically when the Activity
resumes.
So far it's looking like no. I haven't found a ton of results about this (most people run into issues with orientation change, which my app does not allow) but very few ask about going into the background. I have tried every permutation of DialogFragment
and regular Dialog
, but they all disappear when the home button is pressed and the app is opened from the task manager.
I don't even have any code to show because it's all in the testing phase of various examples online. I suspect I will have to manage this myself, by checking in onResume(
) if something should be shown. If this is the case I can live with it, but I'd like to know for sure.