I have a problem with correct dialog fragment dismissing after that orientation was changed. I guess that\'s due to old context because after that activity was recreated there w
Fix is found. Maybe, it's already was written in the one of the fixes of google community which helps to avoid simple dismissing on orientation change and I miss it.
I don't know already. In my case, I have set setRetainInstance(true)
in onCreate
method of DialogFragment
.
Implemented onDismiss
method with simple fix and my last minor problem was that I didn't remove super.onDestroyView()
in onDismiss method. Now it's working like a charm.
Remove the setRetainInstance(true);
from onCreateDialog(Bundle savedInstanceState)
and keep it in onCreate(Bundle savedInstance) as follows :
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
}