From 08189afdb02af22991184bddba74d5402ea7720f Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Thu, 13 Feb 2014 17:02:11 -0800 Subject: [PATCH] Fix bug #12993929 Screen orientation change replaces wifi password dialog with Add network dialog - do not make inactive the fragment when its transition animation is ending. Long explanation: Context: you need to have a first fragment pushed and then a second one replacing the first one, and then create a DialogFragment on top of it. The FragmentManager has then three "active" Fragments. The mActive ArrayList of the FragmentManager is then containing: mActive[0] = first fragment mActive[1] = second fragment (parent of the dialog fragment) mActive[2[ = dialog fragment Then suppose you are changing the orientation. During the restoration of the FragmentManager states, you will see that the first Fragment is marked "inactive" and the mActive ArrayList is looking like: mActive[0] = dialog fragment mActive[1] = second fragment which leads first to have a call to onCreateDialog() for the DialogFragment and before it can be able to restore its state thru the calls to onCreate() and onCreateView() for the parent (the second fragment). Change-Id: I0268bdf13e4bdd07a783c2c82a13b431d0c5c8e4 --- core/java/android/app/FragmentManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java index bf2a6292ce665..ee8d457c11753 100644 --- a/core/java/android/app/FragmentManager.java +++ b/core/java/android/app/FragmentManager.java @@ -972,7 +972,7 @@ final class FragmentManagerImpl extends FragmentManager { if (fragment.mAnimatingAway != null) { fragment.mAnimatingAway = null; moveToState(fragment, fragment.mStateAfterAnimating, - 0, 0, false); + 0, 0, true); } } });