public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); RetainInstance = true; // always re-reate this, because we're going to replace the old one Android restores // with this new one. If we don't, it will be destroyed, because android // fragment manager will see we're replacing ourself and delete us. NavToolbar = new NavToolbarFragment(); // Execute a transaction, replacing any existing // fragment with this one inside the frame. var ft = FragmentManager.BeginTransaction(); ft.Replace(Resource.Id.navtoolbar, NavToolbar); ft.SetTransition(FragmentTransit.FragmentFade); ft.Commit(); }
public override void OnCreate( Bundle savedInstanceState ) { base.OnCreate( savedInstanceState ); RetainInstance = true; NavToolbar = FragmentManager.FindFragmentById(Resource.Id.navtoolbar) as NavToolbarFragment; if (NavToolbar == null) { NavToolbar = new NavToolbarFragment(); } FadeOutFrame = Activity.FindViewById<FrameLayout>(Resource.Id.fadeOutView) as FrameLayout; FadeOutFrame.Alpha = 0.0f; // Execute a transaction, replacing any existing // fragment with this one inside the frame. var ft = FragmentManager.BeginTransaction(); ft.Replace(Resource.Id.navtoolbar, NavToolbar); ft.SetTransition(FragmentTransit.FragmentFade); ft.Commit(); }