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(); } }
public override Android.Support.V4.App.Fragment GetItem(int position) { switch (position) { case 0: return(CalendarFragment.NewInstance()); case 1: return(SafetyMonitoringFragment.NewInstance()); } return(null); }