@Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); int i = item.getItemId(); if (i == R.id.menu_history) { intent.setClassName(this, HistoryActivity.class.getName()); startActivityForResult(intent, HISTORY_REQUEST_CODE); // case R.id.menu_settings: // intent.setClassName(this, PreferencesActivity.class.getName()); // startActivity(intent); // break; // case R.id.menu_help: // intent.setClassName(this, HelpActivity.class.getName()); // startActivity(intent); // break; } else { return super.onOptionsItemSelected(item); } return true; }
@Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); switch (item.getItemId()) { case R.id.menu_share: intent.setClassName(this, ShareActivity.class.getName()); startActivity(intent); break; case R.id.menu_history: intent.setClassName(this, HistoryActivity.class.getName()); startActivityForResult(intent, HISTORY_REQUEST_CODE); break; case R.id.menu_settings: intent.setClassName(this, PreferencesActivity.class.getName()); startActivity(intent); break; case R.id.menu_help: intent.setClassName(this, HelpActivity.class.getName()); startActivity(intent); break; default: return super.onOptionsItemSelected(item); } return true; }
@Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); int itemId = item.getItemId(); if (itemId == fakeR.getId("id", "menu_share")) { intent.setClassName(this, ShareActivity.class.getName()); startActivity(intent); } else if (itemId == fakeR.getId("id", "menu_history")) { intent.setClassName(this, HistoryActivity.class.getName()); startActivityForResult(intent, HISTORY_REQUEST_CODE); } else if (itemId == fakeR.getId("id", "menu_settings")) { intent.setClassName(this, PreferencesActivity.class.getName()); startActivity(intent); } else if (itemId == fakeR.getId("id", "menu_help")) { intent.setClassName(this, HelpActivity.class.getName()); startActivity(intent); } else { return super.onOptionsItemSelected(item); } return true; }
@Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); int itemId = item.getItemId(); if (itemId == R.id.menu_share) { intent.setClassName(this, ShareActivity.class.getName()); startActivity(intent); } else if (itemId == R.id.menu_history) { intent.setClassName(this, HistoryActivity.class.getName()); startActivityForResult(intent, HISTORY_REQUEST_CODE); } else if (itemId == R.id.menu_settings) { intent.setClassName(this, PreferencesActivity.class.getName()); startActivity(intent); } else if (itemId == R.id.menu_help) { intent.setClassName(this, HelpActivity.class.getName()); startActivity(intent); } else { return super.onOptionsItemSelected(item); } return true; }