title: Remove actionbar menu item when closing fragment
body: <p>I'm using the code from the Example section of this page <a href="http://developer.android.com/guide/components/fragments.html" rel="nofollow">http://developer.android.com/guide/components/fragments.html</a></p>
  
  <p>In landscape mode, the activity displays two fragments side-by-side, and on rotation, it launches a new activity containing the "detail" fragment.</p>
  
  <p>The problem is that if I add a menu item to the actionbar from the detail fragment then rotate the screen to portrait to launch the detail fragment in a new activity then exit the activity, the menu item is still displayed even though the fragment supplying the menu item has been removed.</p>
  
  <p>I've tried removing the detail fragment with a FragmentTransaction in onResume and then calling invalidateOptionsMenu(), but it doesn't remove the menu item.</p>
  
  <p>I'm using ActionBarSherlock, and I've also tried supportInvalidateOptionsMenu()</p>
  
  <p>Has anyone else run into this problem?</p>