@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) { Intent intent = new Intent(this, AccountSettingsActivity.class); startActivity(intent); } else if (id == R.id.action_logout) { session.doLogout(); } return super.onOptionsItemSelected(item); }