Merge "Less lazy child FragmentManager creation" into nyc-dev
am: 6437dac3d9
* commit '6437dac3d929297450d1ac937800eb35a5e51ef2':
Less lazy child FragmentManager creation
Change-Id: Ic5917acbe07f67a577ce693680c132d07519d34a
This commit is contained in:
@@ -1486,6 +1486,10 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
|
|||||||
final int version = context != null ? context.getApplicationInfo().targetSdkVersion : 0;
|
final int version = context != null ? context.getApplicationInfo().targetSdkVersion : 0;
|
||||||
if (version >= Build.VERSION_CODES.N) {
|
if (version >= Build.VERSION_CODES.N) {
|
||||||
restoreChildFragmentState(savedInstanceState, true);
|
restoreChildFragmentState(savedInstanceState, true);
|
||||||
|
if (mChildFragmentManager != null
|
||||||
|
&& !mChildFragmentManager.isStateAtLeast(Fragment.CREATED)) {
|
||||||
|
mChildFragmentManager.dispatchCreate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -870,6 +870,10 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isStateAtLeast(int state) {
|
||||||
|
return mCurState >= state;
|
||||||
|
}
|
||||||
|
|
||||||
void moveToState(Fragment f, int newState, int transit, int transitionStyle,
|
void moveToState(Fragment f, int newState, int transit, int transitionStyle,
|
||||||
boolean keepActive) {
|
boolean keepActive) {
|
||||||
if (DEBUG && false) Log.v(TAG, "moveToState: " + f
|
if (DEBUG && false) Log.v(TAG, "moveToState: " + f
|
||||||
|
|||||||
Reference in New Issue
Block a user