title: (Deprecated) Fragment onOptionsItemSelected not being called
body: <p><strong>EDIT:</strong>
  This question was for the deprecated sherlock action bar. Android support library should be used instead now</p>
  
  <p>I have added an action bar menu option called share for my <code>fragment</code> which appears but the selection event is not being caught </p>
  
  <p>I am adding it like this</p>
  
  <pre><code>@Override
  public void onCreateOptionsMenu (Menu menu, MenuInflater inflater) {
      MenuItem item = menu.add(0, 7,0, R.string.share);
      item.setIcon(R.drawable.social_share).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
  }
  </code></pre>
  
  <p>Trying to capture it in both the <code>fragment</code> and the <code>fragment activity</code> like</p>
  
  <pre><code>@Override
  public boolean onOptionsItemSelected(MenuItem item) {
  
      switch (item.getItemId()) {
          case 7:
              Intent share = new Intent(Intent.ACTION_SEND);
              share.setType("text/plain");
              share.putExtra(Intent.EXTRA_TEXT, "I'm being sent!!");
              startActivity(Intent.createChooser(share, "Share Text"));
              return true;
          default:
              return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>and I have <code>setHasOptionsMenu(true);</code> in the <code>onCreate()</code>.</p>