コード例 #1
0
ファイル: MainActivity.java プロジェクト: JANPR/White_Board
  @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);
  }
コード例 #2
0
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   // Handle item selection
   switch (item.getItemId()) {
     case R.id.menu_notes:
       showSectorNotes();
       return true;
     case R.id.menu_search:
       showSearch();
       return true;
     default:
       return super.onOptionsItemSelected(item);
   }
 }
コード例 #3
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case R.id.loader_menu_set_user_id:
        {
          showUserHashDialog();
          return true;
        }

      case R.id.loader_menu_refresh_map_list:
        {
          refreshMapList();
          return true;
        }

      default:
        return super.onOptionsItemSelected(item);
    }
  }