title: Using Options Menu in a multi-Fragment Activity
body: <p>I have a <code>FragmentActivity</code> which hosts a <code>FragmentStatePagerAdapter</code>. The pager contains multiple instances of the same fragment, in order that the user can swipe between the items in a list. I want to be able to provide the user with an options menu which will act only on the visible item.</p>
  
  <p>For example, I have a list of images displayed in imageviews inside fragments. I want an option menu item allowing the user to set the image as their wallpaper.</p>
  
  <p>At the moment when I try this, when <code>onPrepareOptionsMenu</code> is called, the code is called in multiple fragments (usually the current + next one). The same when an item is selected. This causes the wrong image to be set as the wallpaper.</p>
  
  <p>How can I prevent the options menu triggering for more than the currently visible fragment?</p>