private void ReplaceFragment() { GoalListFragment goalListFragment = new GoalListFragment(); FragmentTransaction fragmentTx = this.FragmentManager.BeginTransaction(); fragmentTx.Replace(Resource.Id.frame_container, goalListFragment).Commit(); }
//button.Text = date.ToString ("d"); protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Show fragment on create GoalListFragment goalListFragment = new GoalListFragment(); FragmentTransaction fragmentTransaction = this.FragmentManager.BeginTransaction(); fragmentTransaction.Replace(Resource.Id.frame_container, goalListFragment).Commit(); // Date Picker pickDate = FindViewById <Button> (Resource.Id.date_picker_btn); // add a click event handler to the button pickDate.Click += delegate { ShowDialog(DATE_DIALOG_ID); }; // get the current date date = DateTime.Today; // display the current date (this method is below) UpdateDisplay(); // updates the date in the TextView }