fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
@Override
    public final Object onRetainNonConfigurationInstance() {
        Object custom = onRetainCustomNonConfigurationInstance();

        FragmentManagerNonConfig fragments = mFragments.retainNestedNonConfig();

        if (fragments == null && mViewModelStore == null && custom == null) {
            return null;
        }

        NonConfigurationInstances nci = new NonConfigurationInstances();
        nci.custom = custom;
        nci.viewModelStore = mViewModelStore;
        nci.fragments = fragments;
        return nci;
    }
/**
     * Retain all appropriate fragment state.  You can NOT
     * override this yourself!  Use {@link #onRetainCustomNonConfigurationInstance()}
     * if you want to retain your own state.
     */
Retain all appropriate fragment state.  You can NOT
override this yourself.  Use  #onRetainCustomNonConfigurationInstance()
if you want to retain your own state.
Retain all appropriate fragment state . You can NOT override this yourself . Use #onRetainCustomNonConfigurationInstance () if you want to retain your own state .
@Override
    public final Object onRetainNonConfigurationInstance() {
        Object custom = onRetainCustomNonConfigurationInstance();
        FragmentManagerNonConfig fragments = mFragments.retainNestedNonConfig();
        if (fragments == null && mViewModelStore == null && custom == null) {
            return null;
        }
        NonConfigurationInstances nci = new NonConfigurationInstances();
        nci.custom = custom;
        nci.viewModelStore = mViewModelStore;
        nci.fragments = fragments;
        return nci;
    }
@ Override public final Object onRetainNonConfigurationInstance ( ) { Object custom = onRetainCustomNonConfigurationInstance ( ) ; FragmentManagerNonConfig fragments = mFragments . retainNestedNonConfig ( ) ; if ( fragments == null && mViewModelStore == null && custom == null ) { return null ; } NonConfigurationInstances nci = new NonConfigurationInstances ( ) ; nci . custom = custom ; nci . viewModelStore = mViewModelStore ; nci . fragments = fragments ; return nci ; }
Retain all appropriate fragment state.
Retain all appropriate fragment state .