title: Hide/show MenuItem on click actionbar android
body: <p>I've been trying to get my actionbar buttons to show on click but can't get it to work. I got 2 buttons and if i click on one i want the other to show and the other to get invinsible.
  Here is my code: </p>
  
  <pre><code>@Override
  public boolean onOptionsItemSelected(MenuItem item) {
      MenuItem brandsMenu = (MenuItem)findViewById(R.id.action_brands);
      MenuItem categoryMenu = (MenuItem)findViewById(R.id.action_category);
      switch (item.getItemId()) {
          case R.id.action_category:
              brandsMenu.setVisible(true);
              return true;
          case R.id.action_brands:
              categoryMenu.setVisible(true);
  
      }
  </code></pre>
  
  <p>This only shows errors. Any Suggestions?</p>