@Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case android.R.id.home:
        mMenuDrawer.toggleMenu();
        return true;
    }

    return super.onOptionsItemSelected(item);
  }
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case android.R.id.home:
       NavUtils.navigateUpFromSameTask(this);
       return true;
     case MENU_OVERFLOW:
       mMenuDrawer.toggleMenu();
       return true;
   }
   return super.onOptionsItemSelected(item);
 }
Пример #3
0
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case android.R.id.home:
       mDrawer.toggleMenu();
       break;
       //		case R.id.action_refresh:
       //			mhomeFragment.refresh();
     default:
       break;
   }
   return super.onOptionsItemSelected(item);
 }
Пример #4
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
      case R.id.search: // on pressing home
        search = (EditText) item.getActionView();
        search.addTextChangedListener(filterTextWatcher);
        search.requestFocus();
        InputMethodManager imm =
            (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);

        return true;

      case android.R.id.home: // on pressing home
        mMenuDrawer.toggleMenu();
        return true;
      default:
        return false;
    }
  }