Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
jb...@google.com <jb...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
Description
I have a DialogFragment that opens another DialogFragment as a child. When you rotate the screen, and the dialogs are recreated, the windows are shown in the wrong order (the parent on top of the child, focused - you cannot interact with the child as tapping outside the parent will close both).
This only happens if the second DialogFragment does not override onCreateView (instead using e.g. an AlertDialog as in my sample). If you do override onCreateView, as long as you don't return null, the dialogs will be recreated in the right order. In my sample you can see a TODO where you can uncomment the function in order to fix the issue.
I am attaching a sample project illustrating the issue and two screenshots.
Expected: regardless of what is returned from onCreateView, the two dialog's windows should be recreated in the same order as they were before rotation.