title: onCreateOptionsMenu hit multiples times with fragments
body: <p>I have two ListFragments (A and B, which are actually <code>SherlockListFragments</code>) and when I put a breakpoint in the <code>onCreateOptionsMenu</code> in both fragments, Fragment A is hit 3 times and Fragment B is hit 2 times.  In addition, I am animating one of the menu icon when an <code>AsyncTask</code> is running and if I select an item in Fragment A, <code>onCreateOptionsMenu</code> is called again and the icon double up:</p>
  
  <p><img src="https://i.stack.imgur.com/yfLsR.png" alt="enter image description here"></p>
  
  <p>I'm not sure why <code>onCreateOptionsMenu</code> is called again because I'm just calling a method in the "details" fragment:</p>
  
  <pre><code>@Override
  public void onListItemClick(final ListView l, final View v, final int position, final long id)
  {
      DetailsFragment fragment = (DetailsFragment)getFragmentManager().findFragmentById(R.id.fragmentDetails);
  
      if (fragment != null &amp;&amp; fragment.isInLayout())
      {
          fragment.DisplayItems();
      } 
      else 
      {
          final Intent listing = new Intent(activity.getApplicationContext(), DetailsFragmentActivity.class);
          startActivity(listing);
      }
  }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I'm using this code to animate the menu item:</p>
  
  <pre><code>private MenuItem refreshItem;   
  
  private void DoRefresh() 
  {
      final LayoutInflater inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      final ImageView ivRefresh = (ImageView)inflater.inflate(R.layout.refresh_view, null);
  
      final Animation rotation = AnimationUtils.loadAnimation(activity, R.anim.refresh);
      ImageView ivRefresh.startAnimation(rotation);
  
      refreshItem.setActionView(ivRefresh);
  
      //AsyncTask is kicked off here
  }
  
  @Override
  public boolean onOptionsItemSelected(final MenuItem item) 
  {
      if (item.getItemId() == R.id.refresh) {
          refreshItem = item;
          this.DoRefresh();
          return true;
      } else {
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>