android.support.v7.app.ActionBarActivity.onOptionsItemSelected()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(49)

本文整理了Java中android.support.v7.app.ActionBarActivity.onOptionsItemSelected()方法的一些代码示例,展示了ActionBarActivity.onOptionsItemSelected()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActionBarActivity.onOptionsItemSelected()方法的具体详情如下:
包路径:android.support.v7.app.ActionBarActivity
类名称:ActionBarActivity
方法名:onOptionsItemSelected

ActionBarActivity.onOptionsItemSelected介绍

暂无

代码示例

代码示例来源:origin: joelittlejohn/jsonschema2pojo

@Override
  public boolean onOptionsItemSelected(MenuItem item)
  {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings)
    {
      return true;
    }

    return super.onOptionsItemSelected(item);
  }
}

代码示例来源:origin: zzz40500/android-shapeLoadingView

@Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
      return true;
    }

    return super.onOptionsItemSelected(item);
  }
}

代码示例来源:origin: zzz40500/android-shapeLoadingView

@Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
      return true;
    }

    return super.onOptionsItemSelected(item);
  }
}

代码示例来源:origin: zzz40500/android-shapeLoadingView

@Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
      return true;
    }

    return super.onOptionsItemSelected(item);
  }
}

代码示例来源:origin: balysv/material-ripple

@Override
public boolean onOptionsItemSelected(MenuItem item) {
  int id = item.getItemId();
  if (id == R.id.switch_button) {
    startActivity(new Intent(this, DemoActivity.class));
    finish();
    return true;
  } else if (id == R.id.switch_list) {
    startActivity(new Intent(this, DemoListActivity.class));
    finish();
    return true;
  }
  return super.onOptionsItemSelected(item);
}

代码示例来源:origin: balysv/material-ripple

@Override
  public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.switch_list) {
      startActivity(new Intent(this, DemoListActivity.class));
      finish();
      return true;
    } else if (id == R.id.switch_recycler) {
      startActivity(new Intent(this, DemoRecyclerActivity.class));
      finish();
      return true;
    }
    return super.onOptionsItemSelected(item);
  }
}

代码示例来源:origin: balysv/material-ripple

@Override
  public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == R.id.switch_button) {
      startActivity(new Intent(this, DemoActivity.class));
      finish();
      return true;
    } else if (id == R.id.switch_recycler) {
      startActivity(new Intent(this, DemoRecyclerActivity.class));
      finish();
      return true;
    }
    return super.onOptionsItemSelected(item);
  }
}

代码示例来源:origin: asyl/ArcAnimator

@Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
      return true;
    }

    return super.onOptionsItemSelected(item);
  }
}

代码示例来源:origin: ogaclejapan/ArcLayout

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 switch (item.getItemId()) {
  case R.id.menu_github:
   openGitHub();
   return true;
  default:
   return super.onOptionsItemSelected(item);
 }
}

代码示例来源:origin: ogaclejapan/ArcLayout

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId() == android.R.id.home) {
  finish();
  return true;
 }
 return super.onOptionsItemSelected(item);
}

代码示例来源:origin: ogaclejapan/ArcLayout

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 switch (item.getItemId()) {
  case android.R.id.home:
   finish();
   break;
  default:
   return super.onOptionsItemSelected(item);
 }
 return true;
}

代码示例来源:origin: ogaclejapan/ArcLayout

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId() == android.R.id.home) {
  finish();
  return true;
 }
 return super.onOptionsItemSelected(item);
}

代码示例来源:origin: dkim0419/SoundRecorder

@Override
public boolean onOptionsItemSelected(MenuItem item) {
  // Handle action bar item clicks here. The action bar will
  // automatically handle clicks on the Home/Up button, so long
  // as you specify a parent activity in AndroidManifest.xml.
  // Handle presses on the action bar items
  switch (item.getItemId()) {
    case R.id.action_settings:
      Intent i = new Intent(this, SettingsActivity.class);
      startActivity(i);
      return true;
    default:
      return super.onOptionsItemSelected(item);
  }
}

代码示例来源:origin: ogaclejapan/ArcLayout

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 switch (item.getItemId()) {
  case android.R.id.home:
   finish();
   break;
  case R.id.menu_reverse:
   arcLayout.setReverseAngle(!arcLayout.isReverseAngle());
   break;
  default:
   return super.onOptionsItemSelected(item);
 }
 return true;
}

代码示例来源:origin: scola/Qart

return super.onOptionsItemSelected(item);

代码示例来源:origin: ssomai/ScalableLayout

@Override
public boolean onOptionsItemSelected(MenuItem item) {
  // Handle action bar item clicks here. The action bar will
  // automatically handle clicks on the Home/Up button, so long
  // as you specify a parent activity in AndroidManifest.xml.
  int id = item.getItemId();
  //noinspection SimplifiableIfStatement
  if (id == com.ssomai.android.sample_scalablelayout.R.id.action_settings) {
    return true;
  }
  return super.onOptionsItemSelected(item);
}

代码示例来源:origin: dialogflow/dialogflow-android-client

@Override
  public boolean onOptionsItemSelected(final MenuItem item) {
    final int id = item.getItemId();
    return super.onOptionsItemSelected(item);
  }
}

代码示例来源:origin: p-v/FlexibleCalendar

@Override
public boolean onOptionsItemSelected(MenuItem item) {
  // Handle action bar item clicks here. The action bar will
  // automatically handle clicks on the Home/Up button, so long
  // as you specify a parent activity in AndroidManifest.xml.
  int id = item.getItemId();
  //noinspection SimplifiableIfStatement
  if (id == R.id.action_settings) {
    return true;
  }
  return super.onOptionsItemSelected(item);
}

代码示例来源:origin: posm/OpenMapKitAndroid

@Override
public boolean onOptionsItemSelected(MenuItem item) {
  // Handle action bar item clicks here. The action bar will
  // automatically handle clicks on the Home/Up button, so long
  // as you specify a parent activity in AndroidManifest.xml.
  int id = item.getItemId();
  // save to odk collect action bar button
  if (id == R.id.action_save_to_odk_collect) {
    saveToODKCollect();
  }
  return super.onOptionsItemSelected(item);
}

代码示例来源:origin: p-v/FlexibleCalendar

public boolean onOptionsItemSelected(MenuItem item) {
  switch (item.getItemId()) {
    case android.R.id.home:
      finish();
      break;
    default:
      break;
  }
  return super.onOptionsItemSelected(item);
}

相关文章