コード例 #1
0
        private void MenuItemClicked(int menuId)
        {
            Android.Support.V4.App.Fragment fragment = null;
            switch (menuId)
            {
            case Resource.Id.nav_home:
                fragment = CalendarFragment.NewInstance();
                break;

            case Resource.Id.nav_SaftyMonitoring:
            {
                fragment = SafetyMonitoringFragment.NewInstance();
            }
            break;

            case Resource.Id.nav_visits:
            {
                var intent = new Intent(this, typeof(MyShiftActivity));

                StartActivity(intent);
                Finish();
                return;
            }
            }
            if (fragment != null)
            {
                SupportFragmentManager.BeginTransaction()
                .Replace(Droid.Resource.Id.content_frame, fragment)
                .Commit();
            }
        }
コード例 #2
0
        public override Android.Support.V4.App.Fragment GetItem(int position)
        {
            switch (position)
            {
            case 0: return(CalendarFragment.NewInstance());

            case 1: return(SafetyMonitoringFragment.NewInstance());
            }
            return(null);
        }