Skip to content

Instantly share code, notes, and snippets.

@user-mw
Created December 8, 2019 16:26
Show Gist options
  • Select an option

  • Save user-mw/7c56bd9fc9c2e5a2284cf19268cefbc5 to your computer and use it in GitHub Desktop.

Select an option

Save user-mw/7c56bd9fc9c2e5a2284cf19268cefbc5 to your computer and use it in GitHub Desktop.
FragmentActivity onRetainNonConfigurationInstance() retain FragmentManagerNonConfig
public final Object onRetainNonConfigurationInstance() {
// Code
FragmentManagerNonConfig fragments = mFragments.retainNestedNonConfig();
// Code
NonConfigurationInstances nci = new NonConfigurationInstances();
nci.custom = custom;
nci.viewModelStore = mViewModelStore;
nci.fragments = fragments;
return nci;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment