Exemple #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if (Resources.Configuration.Orientation == Android.Content.Res.Orientation.Landscape)
            {
                Finish();
            }

            var showId        = Intent.Extras.GetInt("current_id", 0);
            var playQuoteFrag = NoteFragment.NewInstance(showId);

            FragmentManager.BeginTransaction()
            .Add(Android.Resource.Id.Content, playQuoteFrag)
            .Commit();
        }
        void ShowNoteContent(int showId)
        {
            if (showingTwoFragments)
            {
                selectedShowId = showId;
                ListView.SetItemChecked(selectedShowId, true);

                var showNoteFragment = FragmentManager.FindFragmentById(Resource.Id.playquote_container) as NoteFragment;
                if (showNoteFragment == null || showNoteFragment.ShowId != showId)
                {
                    var quoteFrag = NoteFragment.NewInstance(selectedShowId);

                    FragmentTransaction ft = FragmentManager.BeginTransaction();
                    ft.Replace(Resource.Id.playquote_container, quoteFrag);
                    ft.Commit();
                }
            }
            else
            {
                var intent = new Intent(Activity, typeof(NoteActivity));
                intent.PutExtra("current_id", showId);
                StartActivity(intent);
            }
        }