protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this._isHidden = false; Bundle bundledInfo = bundle ?? this.Intent.Extras; this.ResolveWizardType(bundledInfo); this.ResolveBundledItems(bundledInfo); this.SetContentView(Resource.Layout.activity_wizard); this.AddToolbar(this.WizardHelper.ScreenTitle); if (bundle == null) { this._fragmentButtons = new FragmentButtons(); this.SupportFragmentManager.BeginTransaction() .Add(Resource.Id.frameButtons, this._fragmentButtons, this._fragmentButtons.FragmentTag) .Commit(); this.ResolveFragmentToLoad(null); this.LoadFragment(); } else { // get the history back this._stepsHistory = JsonConvert.DeserializeObject <Dictionary <int, Type> >(bundle.GetString(WizardStepHistoryKey)); // rebuild all the fragments this.CurrentFragment = this.SupportFragmentManager.GetFragment(bundle, MainFragmentKey) as WizardStepFragment; this._fragmentButtons = this.SupportFragmentManager.GetFragment(bundle, ButtonsFragmentKey) as FragmentButtons; if (this.CurrentFragment != null) { this.CurrentFragment.SetData(this._serializedData); } IsProspectConversion = bundle.GetBoolean(DontCheckKey); } this._tvTitle = this.FindViewById <TextView>(Resource.Id.tvTitle); }
/// <summary> /// This method is called if the wizard activity is launched while it is on top os the stack. /// This coupled with LaunchMode = SingleTop, ensures that we dont stack wizards on top of each other /// </summary> /// <param name="intent">The new intent to use for re-launching the wizard</param> protected override void OnNewIntent(Intent intent) { base.OnNewIntent(intent); this.HideOverlay(true); this.Intent = intent; this.ResolveWizardType(intent.Extras); this.ResolveBundledItems(intent.Extras); this.SetScreenTitle(this.WizardHelper.ScreenTitle); this._fragmentButtons = new FragmentButtons(); this.SupportFragmentManager.BeginTransaction() .Replace(Resource.Id.frameButtons, this._fragmentButtons, this._fragmentButtons.FragmentTag) .Commit(); _currentFragmentType = WizardHelper.GetFirstFragment(); this.LoadFragment(); this._tvTitle = this.FindViewById <TextView>(Resource.Id.tvTitle); }