title: SupportActionBar not setting visibility as I want
body: <p>I'm using ActionBar from support library. I want to change the visibility of one <code>MenuItem</code> on runtime. In most cases this works fine, but sometimes, hiding does not work as expected. I am using the following code to change the visibility:</p>
  
  <pre><code>@Override
  public boolean onPrepareOptionsMenu(Menu menu) {
  
      boolean show = /* some condition */
      myMenuItem.setVisible(show); // I got myMenuItem from onCreateOptionsMenu()
      return superRetVal;
  }
  </code></pre>
  
  <p>As I said, this works fine for most cases. But if I make a FragmentTransaction and then call <code>invalidateOptionsMenu()</code>, it sometimes gets an error. The error is that the icon itself is hidden because <code>show == false</code>, but the space is still blocked (like when setting <code>View.setVisibility(View.INVISIBLE)</code>). In the screenshow below, you may see the space is still blocked. I have highlighted the unused, but blocked space with a red box..  After this error occurs once, I can only get rid of it by clicking on the overflow menu. Until then, no <code>MenuItem.setVisible()</code> will have any effect.  </p>
  
  <p><img src="https://i.stack.imgur.com/zgaPg.png" alt="ActionBar"></p>
  
  <p>What's the problem here?<br>
  Thanks!</p>
  
  <p><strong>Edit</strong><br>
  The item <code>menu_to_current</code> is causing the problem:  </p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" 
  xmlns:malaka="http://schemas.android.com/apk/res-auto" &gt;
  
  &lt;item 
      android:id="@+id/menu_to_current"
      android:orderInCategory="100"
      android:title="To Current"
      android:icon="@drawable/ic_menu_current"
      malaka:showAsAction="always"
      android:visible="false"/&gt;
  
  &lt;item 
      android:id="@+id/menu_show_buttons"
      android:orderInCategory="100"
      android:title="Show Buttons"
      malaka:showAsAction="never"/&gt;
  
  &lt;item  
      android:id="@+id/menu_settings"
      android:orderInCategory="100"
      android:title="Settings"
      android:icon="@android:drawable/ic_menu_preferences"
      malaka:showAsAction="never"/&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p><strong>Edit2</strong><br>
  I was testing on emulator api 16. I now additionally tested on real device api 10, real device api 18, emulator api 18. And the error only occurs on emulator api 16. Unfortunately I don't have a real device api 16 available to test that.</p>