How "onOptionsItemSelected" works for Fragments?
<p>Menu Items getting disappeared in my app.</p>

<p>Initially i created menu items as follow. but menu getting disappeared in some android versions.</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    TabHelper tabHelper = getTabHelper();
    CompatTab menuTab = tabHelper.newTab("menu").setText(
        R.string.tab_section1).setIcon(R.drawable.home_icon).setTabListener(
        new InstantiatingTabListener(this, MenuFragment.class));
    tabHelper.addTab(menuTab);
    CompatTab favTab = tabHelper.newTab("favourites").setText(
        R.string.tab_section2).setIcon(R.drawable.favourites_icon).setTabListener(
        new InstantiatingTabListener(this, FavouritesFragment.class));
    tabHelper.addTab(favTab);
}
</code></pre>

<p>THIS ABOVE CODE WORKS FINE IN LATEST ANDROID 4.1.3 BUT FAILS TO DISPLAY IN 4.0.1 and 4.0.3
SEEMS TO BE SOME LAYOUT ISSUE.</p>

<p>TO RESOLVE i added menu xml as follow</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;item android:id="@+id/menuhome"
    android:icon="@drawable/map_icon"
    android:title="@string/tab_section1"
    android:orderInCategory="1"
    android:showAsAction="always|withText" /&gt;
 &lt;item android:id="@+id/menumap"
    android:icon="@drawable/map_icon"
    android:title="@string/tab_section2"
    android:orderInCategory="2"
    android:showAsAction="always|withText" /&gt;
</code></pre>

<p></p>

<p>and added onOptionItemSelected as follow</p>

<pre><code>   @Override
   public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case android.R.id.menuhome:
            finish();
            return true;
        case R.id.menumap:

             //ERROR
             //HOW CAN I CALL FRAGMENT HERE.?

            break;
        default:
            break;
    }
    return super.onOptionsItemSelected(item);
}
</code></pre>
