title: Android - MenuItem.setIcon() not working when adding fragment
body: <p>In my mainFragment I have menuItem for notifications, when I receive a notification, I change the icon of the menuItem (to icon with a badge) and it works fine; then I click the menuItem to show the list of notifications (add fragment). when I go back to the mainFragment, the menuItem icon doesn't change anymore when I receive a notification</p>
  
  <p>here is my code on the main fragment:</p>
  
  <pre><code>private MenuItem menuItem;
  
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
      inflater.inflate(R.menu.menu_main, menu);
      menuItem = menu.findItem(R.id.action_item);
      super.onCreateOptionsMenu(menu, inflater);
  }
  
  
  public void methodCalledToChangeIcon() {
      if (condition)
          menuItem.setIcon(getResources().getDrawable(R.drawable.ic_action));
      else
          menuItem.setIcon(getResources().getDrawable(R.drawable.ic_action_checked));
  }
  </code></pre>
  
  <p>any help please.</p>