private void ShowPlayNote(int playId) { selectedPlayId = playId; if (showingTwoFragments) { ListView.SetItemChecked(selectedPlayId, true); var playNoteFragment = FragmentManager.FindFragmentById(Resource.Id.playnote_container) as PlayNoteFragment; if (playNoteFragment == null || playNoteFragment.PlayId != playId) { var container = Activity.FindViewById(Resource.Id.playnote_container); var noteFrag = PlayNoteFragment.NewInstance(selectedPlayId); FragmentTransaction ft = FragmentManager.BeginTransaction(); ft.Replace(Resource.Id.playnote_container, noteFrag); ft.Commit(); } } else { var intent = new Intent(Activity, typeof(PlayNoteActivity)); intent.PutExtra("current_play_id", playId); StartActivity(intent); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); if (Resources.Configuration.Orientation == Android.Content.Res.Orientation.Landscape) { Finish(); } PlayId = Intent.Extras.GetInt("current_play_id", 0); var playNoteFrag = PlayNoteFragment.NewInstance(PlayId); FragmentManager.BeginTransaction() .Add(Android.Resource.Id.Content, playNoteFrag) .Commit(); }