Framework edition
Fix a bug where child FragmentManagers moving too lazily into the
CREATED state and beyond caused child fragments to not be
attached/created when expected.
Bug
25019275
Change-Id: I04ff0d3bcb693178a6ee3057da591392defdbcf8
final int version = context != null ? context.getApplicationInfo().targetSdkVersion : 0;
if (version >= Build.VERSION_CODES.N) {
restoreChildFragmentState(savedInstanceState, true);
+ if (mChildFragmentManager != null
+ && !mChildFragmentManager.isStateAtLeast(Fragment.CREATED)) {
+ mChildFragmentManager.dispatchCreate();
+ }
}
}
}
}
+ boolean isStateAtLeast(int state) {
+ return mCurState >= state;
+ }
+
void moveToState(Fragment f, int newState, int transit, int transitionStyle,
boolean keepActive) {
if (DEBUG && false) Log.v(TAG, "moveToState: " + f