title: Jump to another activity when clicking a item in menu of actionbar in android studio
body: <p>This is the code for select items in menu, when user click logout, the activity jumps to login_activity, when user clicks account, the activity jumps to account_activity.</p>
  
  <pre><code>@Override
  public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()){
          case R.id.logout_id:
              Intent login = new Intent(MainpanelActivity.this, LoginActivity.class);
              login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
              startActivity(login);
          case R.id.account_id:
              Intent account =new Intent(MainpanelActivity.this,AccountActivity.class);
              startActivity(account);
              default:
                  return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>However, during the testing, no matter what i click, the activity always jumps to the account activity.</p>
  
  <p>If i switch the order of the switch cases</p>
  
  <pre><code>@Override
  public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()){
          case R.id.account_id:
              Intent account =new Intent(MainpanelActivity.this,AccountActivity.class);
              startActivity(account);
          case R.id.logout_id:
              Intent login = new Intent(MainpanelActivity.this, LoginActivity.class);
              login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
              startActivity(login);
  
              default:
                  return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>no matter what i click, the activity always jumps to the login_activity. Anybody knows why?</p>