public override bool OnOptionsItemSelected(IMenuItem item) { Android.Views.InputMethods.InputMethodManager inputMethodManager = (Android.Views.InputMethods.InputMethodManager) this.GetSystemService(MainActivity.InputMethodService); inputMethodManager.HideSoftInputFromWindow(this.CurrentFocus.WindowToken, 0); if (drawerToggle.OnOptionsItemSelected(item)) { return(true); } switch (item.ItemId) { case Android.Resource.Id.Home: drawerLayout.OpenDrawer(GravityCompat.Start); return(true); } #if SCREENSHOT if (item != null && item.TitleFormatted != null) { if (AppResources.TakeAPicture == item.TitleFormatted.ToString()) { Task.Run(() => { RunOnUiThread(() => { if (!ScreenshotVM.InScreenshot) { //ScreenshotVM.CaptureScreens(Navigate.screenshotScreen); } }); }); } } #endif return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(IMenuItem item) { if (drawerToggle.OnOptionsItemSelected(item)) { return(true); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(IMenuItem item) { if (mDrawerToggle.OnOptionsItemSelected(item)) { return(true); } if (item.ItemId == Android.Resource.Id.Home) { OnBackPressed(); this.HideKeyboard(); } return(base.OnOptionsItemSelected(item)); }
public override bool OnOptionsItemSelected(IMenuItem item) { // The action bar home/up action should open or close the drawer. // ActionBarDrawerToggle will take care of this. if (mDrawerToggle.OnOptionsItemSelected(item)) { return(true); } // Handle action buttons switch (item.ItemId) { case Resource.Id.action_websearch: Intent intent = new Intent(Intent.ActionWebSearch); intent.PutExtra(SearchManager.Query, this.SupportActionBar.Title); if (intent.ResolveActivity(this.PackageManager) != null) { StartActivity(intent); } else { Toast.MakeText(this, Resource.String.app_not_available, ToastLength.Long).Show(); } return(true); case Resource.Id.menu_login: Intent intentLogin = new Intent(this, typeof(Login)); // intentLogin.PutExtra(SearchManager.Query, this.SupportActionBar.Title); StartActivity(intentLogin); if (intentLogin.ResolveActivity(PackageManager) == null) { Toast.MakeText(this, "Não abriu", ToastLength.Long).Show(); } return(true); default: return(base.OnOptionsItemSelected(item)); } }
bool DrawerToggleOnOptionsItemSelected(IMenuItem item) { return(drawerToggle.OnOptionsItemSelected(item)); }