title: Fragment menu's not changing
body: <p>i'm trying to figure out why the menu is not changing in the actionbar when switching between fragments in my main activity. I've tried some of the suggestions about setHasOptionsMenu(true) and menu.clear and no luck... I just don't get it.</p>
  
  <p>ConsoleActivity.class</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
  
    // Set up the action bar to show a dropdown list.
    final ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
  
    // Set up the dropdown list navigation in the action bar.
    actionBar.setListNavigationCallbacks(
  
    // Specify a SpinnerAdapter to populate the dropdown list.
    new ArrayAdapter&lt;String&gt;(actionBar.getThemedContext(),
      android.R.layout.simple_list_item_1,
      android.R.id.text1, new String[] {
      getString(R.string.NavItem1),
      getString(R.string.NavItem2) }), this);
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
  }
  
  
  @Override
  public boolean onNavigationItemSelected(int position, long id) {
    // When the given dropdown item is selected, show its contents in the
    // container view.
    Fragment fragment = new SectionFragment();
    Bundle args = new Bundle();
    args.putInt(SectionFragment.ARG_SECTION_NUMBER, position + 1);
    fragment.setArguments(args);
    getFragmentManager().beginTransaction().replace(R.id.container, fragment).commit();
    return true;
  }
  
  
  public static class SectionFragment extends Fragment {
  /**
  * The fragment argument representing the section number for this
  * fragment.
  */
  public static final String ARG_SECTION_NUMBER = "section_number";
  
  public SectionFragment() {
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Create a new TextView and set its text to the fragment's section
    // number argument value.
    View mView = null;
    switch (getArguments().getInt(ARG_SECTION_NUMBER)) {
    case 1:
      mView = (View) inflater.inflate(R.layout.schedule_fragment, container, false);
      break;
    case 2:
      mView = (View) inflater.inflate(R.layout.timesheet_fragment, container, false);
      break;
    }         
    return mView;
  }
  </code></pre>
  
  <p>ScheduleFragment.class:</p>
  
  <pre><code>import android.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  public class ScheduleFragment extends Fragment {
  
    public void onCreate(Bundle savedInstanceState) {
      setHasOptionsMenu(true);
      super.onCreate(savedInstanceState);
    }
  
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
      return inflater.inflate(R.layout.schedule_fragment, null);
    }
  
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
      inflater.inflate(R.menu.schedule_context, menu);
      super.onCreateOptionsMenu(menu, inflater);
    }
  
  }
  </code></pre>
  
  <p>schedule.xml in menu folder:</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/menu_edit_trips"
            android:icon="@drawable/ic_menu_trips"
            android:title="Trips"
            android:showAsAction="always|withText"&gt;
          &lt;menu&gt;
              &lt;item android:id="@+id/menuitem_trip_edit"
                    android:icon="@drawable/ic_menu_trip_edit"
                    android:title="Edit" /&gt;
  
              &lt;item android:id="@+id/menuitem_trip_new"
                    android:icon="@drawable/ic_menu_trip_new"
                    android:title="New" /&gt;
  
              &lt;item android:id="@+id/menuitem_trip_cancel"
                    android:icon="@drawable/ic_menu_trip_cancel"
                    android:title="Cancel" /&gt;
          &lt;/menu&gt; 
      &lt;/item&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p>main.xml in menu folder. This is the menu that remains consistent between all the fragments:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;item android:id="@+id/menuitem_main"
            android:icon="@drawable/ic_menu_main"
            android:title="Main"
            android:showAsAction="always"&gt;
          &lt;menu&gt;
              &lt;item
                  android:id="@+id/menuitem_logout"
                  android:icon="@drawable/ic_menu_main_logout"
                  android:title="Logout" /&gt;
  
              &lt;item
                  android:id="@+id/menuitem_about"
                  android:icon="@drawable/ic_menu_main_about"
                  android:title="About" /&gt;
  
              &lt;item
                  android:id="@+id/menuitem_settings"
                  android:icon="@drawable/ic_menu_main_settings"
                  android:title="@string/menu_settings" /&gt;
          &lt;/menu&gt;
      &lt;/item&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p>I'm not sure what to do...</p>