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

x33g5p2x  于2022-01-15 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(363)

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

Activity.onOptionsItemSelected介绍

暂无

代码示例

代码示例来源:origin: androidannotations/androidannotations

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

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public boolean onOptionsItemSelected(MenuItem item) {
  switch (item.getItemId()) {
   case R.id.settings:
    startActivity(new Intent(this, EditPreferences.class));

    return(true);
  }

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

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId() == R.id.legal) {
  startActivity(new Intent(this, LegalNoticesActivity.class));
  return(true);
 }
 return(super.onOptionsItemSelected(item));
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId() == R.id.legal) {
  startActivity(new Intent(this, LegalNoticesActivity.class));
  return(true);
 }
 return(super.onOptionsItemSelected(item));
}

代码示例来源:origin: commonsguy/cw-omnibus

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

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (toggle.onOptionsItemSelected(item)) {
  return(true);
 }
 return(super.onOptionsItemSelected(item));
}

代码示例来源:origin: commonsguy/cw-omnibus

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

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public boolean onOptionsItemSelected(MenuItem item) {
  switch (item.getItemId()) {
   case R.id.settings:
    startActivity(new Intent(this, EditPreferences.class));

    return(true);
  }

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

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public boolean onOptionsItemSelected(MenuItem item) {
  switch (item.getItemId()) {
   case R.id.settings:
    startActivity(new Intent(this, EditPreferences.class));

    return(true);
  }

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

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public boolean onOptionsItemSelected(MenuItem item) {
  switch (item.getItemId()) {
   case R.id.settings:
    startActivity(new Intent(this, EditPreferences.class));

    return(true);
  }

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

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (toggle.onOptionsItemSelected(item)) {
  return(true);
 }
 return(super.onOptionsItemSelected(item));
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public boolean onOptionsItemSelected(MenuItem item) {
  switch (item.getItemId()) {
   case R.id.settings:
    startActivity(new Intent(this, EditPreferences.class));

    return(true);
  }

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

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId()==R.id.settings) {
  startActivity(new Intent(Settings.ACTION_DATE_SETTINGS));
 }
 return(super.onOptionsItemSelected(item));
}

代码示例来源:origin: commonsguy/cw-omnibus

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

代码示例来源:origin: evernote/android-job

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

代码示例来源:origin: commonsguy/cw-omnibus

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

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId()==R.id.launch) {
  startActivity(new Intent(this, DropActivity.class)
   .setFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT |
        Intent.FLAG_ACTIVITY_NEW_TASK |
        Intent.FLAG_ACTIVITY_MULTIPLE_TASK));
  return(true);
 }
 return(super.onOptionsItemSelected(item));
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId()==R.id.settings) {
  Intent i=new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
  i.putExtra(Settings.EXTRA_CHANNEL_ID, CHANNEL_BATTLE);
  i.putExtra(Settings.EXTRA_APP_PACKAGE, getPackageName());
  startActivity(i);
 }
 return super.onOptionsItemSelected(item);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId()==R.id.backup) {
  BackupService.enqueueWork(this);
  return(true);
 }
 else if (item.getItemId()==R.id.restore) {
  startActivity(new Intent(this, RestoreRosterActivity.class));
  return(true);
 }
 return(super.onOptionsItemSelected(item));
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId()==R.id.auth) {
  authenticate();
  return true;
 }
 else if (item.getItemId()==R.id.hw) {
  isInsideSecureHardware();
 }
 return super.onOptionsItemSelected(item);
}

相关文章

Activity类方法