public static ShowFragment newInstance(string answer) { ShowFragment fragment = new ShowFragment(); fragment.answer = answer; return(fragment); }
public void OnClick(View v) { switch (v.Id) { case Resource.Id.btn_continue: int selectedId = radioGroup.CheckedRadioButtonId; RadioButton radioButton = radioGroup.FindViewById <RadioButton>(selectedId); string text = radioButton.Text; ShowFragment showFragment = ShowFragment.newInstance($"{etQuestion.Text.ToString()} ({text})"); FragmentTransaction transaction = this.FragmentManager.BeginTransaction(); transaction.Replace(Resource.Id.container, showFragment); etQuestion.Text = ""; transaction.AddToBackStack(null); transaction.Commit(); break; } }