I experience a strange, possibly version-specific behavior, with my DialogFragment subclass when testing the following steps:
(1) Open the dialog box. (2) Leave the application with the "Home" or "Recent Applications" key
(3) Return to the application, and the dialogue will no longer be displayed. It seems that this is briefly, transparently visible behind the main activity. (4) Turn the device and the dialog box will reappear.
This error occurs on my Asus TF700T player running Android 4.2.1, and it does not happen on my Motorola Razr phone with Android 4.1.2 (which has a menu key and not an overflow button). Moreover, this only happens if the dialog opens through the overflow menu - dialogs opened with ActionBar elements do not show this problem! And finally, the problem does not occur if you make a change in orientation before pausing activity.
I found a very similar problem that includes depressing comments such as "This is clearly an Android bug." There are related error reports. Please say that this is not so ...
My workaround for this problem is in onResume (): I check the FragmentManager for existing dialogs with findFragmentByTag; if they are not null, I fire them and resubmit. But I would like to understand what is happening here.
android android-actionbar android-fragments android-dialogfragment fragmentmanager
sacheie
source share