Esempio n. 1
0
        public void OnCrimeSelected(Crime crime)
        {
            if (FindViewById(Resource.Id.detailFragmentContainter) == null)
            {
                // Start an instance of CrimePagerActivity
                Intent i = new Intent(this, typeof(CrimePagerActivity));
                i.PutExtra(CrimeFragment.EXTRA_CRIME_ID, crime.Id);
                StartActivity(i);
            }
            else
            {
                Android.Support.V4.App.FragmentManager     fm = SupportFragmentManager;
                Android.Support.V4.App.FragmentTransaction ft = fm.BeginTransaction();

                Android.Support.V4.App.Fragment oldDetail = fm.FindFragmentById(Resource.Id.detailFragmentContainter);
                Android.Support.V4.App.Fragment newDetail = CrimeFragment.NewInstance(crime.Id);

                if (oldDetail != null)
                {
                    ft.Remove(oldDetail);
                }

                ft.Add(Resource.Id.detailFragmentContainter, newDetail);
                ft.Commit();
            }
        }
Esempio n. 2
0
        public override Android.Support.V4.App.Fragment GetItem(int position)
        {
            Crime crime = CONTENT[position];

            return(CrimeFragment.NewInstance(crime.Id));
        }