The easiest way to find this is to track the lifetime of the dialog in action and do hide() / show() in onResume for activity. This solution only works for one Dialog at a time, but can be easily adapted to more if necessary.
1) Make your activity an implementation of Dialog.OnDismissListener .
2) Add an instance variable for the current Dialog in the Activity :
private Dialog currentDialog = null;
3) In onResume() add:
if(currentDialog != null) { currentDialog.hide(); currentDialog.show(); }
4) For each dialog box created in onCreateDialog() , add:
dialog.setOnDismissListener(this); currentDialog = dialog;
5) Finally, add:
@Override public void onDismiss(DialogInterface dialog) { if(dialog == currentDialog) currentDialog = null; }
I think this is fixed.
source share