title: Trying to hide a menuitem in Android, not behaving as expected
body: <p>I have the below menu item created and is showing always as an action, instead of being hidden in an overflow menu.</p>
  
  <pre><code>&lt;item android:id="@+id/menu_refresh_network"
      android:orderInCategory="100"
      android:icon="@drawable/ic_menu_action_refresh_network"
      android:title="@string/title_refresh_network"
      android:enabled="true"
      app:showAsAction="always" /&gt;
  </code></pre>
  
  <p>I need it to be hidden when <code>ThreshVoteIntentService.mOpportunistic</code> is <code>TRUE</code>. I have a receiver which is alerted by intent when that value has changed. It's a very simple procedure that invalidates the menu.</p>
  
  <pre><code>IntentFilter filterModeUpdated = new IntentFilter(resources.getString(R.string.action_mode_updated));
  mModeUpdatedReceiver = new BroadcastReceiver() {
      @Override
      public void onReceive(Context context, Intent intent) {
          invalidateOptionsMenu();
      }
  };
  
  this.registerReceiver(mModeUpdatedReceiver, filterModeUpdated);
  </code></pre>
  
  <p>I have my options menu then (supposedly) redraw in <code>onPrepareOptionsMenu</code>.</p>
  
  <pre><code>@Override
  public boolean onPrepareOptionsMenu (Menu menu) {
      menu.findItem(R.id.menu_refresh_network).setVisible(ThreshVoteIntentService.mOpportunistic);
  
      return super.onPrepareOptionsMenu(menu);
  }
  </code></pre>
  
  <p><strong>What actually happens</strong> is that the visibility of <code>menu_refresh_network</code> only changes when I open the overflow menu. Have I basically misunderstood how this should work?</p>