public override void OnSaveInstanceState(Bundle outState) { base.OnSaveInstanceState(outState); outState.PutInt(FRAGMENT_STACK_SIZE_KEY, this.Fragments.Count()); for (int i = 0; i < this.Fragments.Count(); ++i) { this.ChildFragmentManager.PutFragment( outState, FragmentStackNavigationController.CreateFragmentKeyForIndex(i), this.Fragments.ElementAt(i) ); } }
public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); if (savedInstanceState != null) { var fragmentCount = savedInstanceState.GetInt(FRAGMENT_STACK_SIZE_KEY); for (int i = 0; i < fragmentCount; ++i) { var fragment = this.ChildFragmentManager.GetFragment( savedInstanceState, FragmentStackNavigationController.CreateFragmentKeyForIndex(i) ); this.fragmentsStack.Push(fragment); } } }