I am utilizing the stock Navigation Drawer Activity to host a series of fragments. I am trying to implement seperate ActionBar Buttons when I change to different fragments from within the navigation drawer.
I am running into an issue where the items are not being added to the actionbar directly and are instead being added to the "triple dot" overflow menu as a drop down selection.
What am I doing wrong that the buttons are not becoming available on the actionbar?
JOBFRAGMENT
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
setHasOptionsMenu(true);
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_jobs, container, false);
return view;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
// TODO Add your menu entries here
//inflater = getActivity().getMenuInflater();
inflater.inflate(R.menu.job_navigation, menu);
super.onCreateOptionsMenu(menu, inflater);
}
MENU XML
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_drawer"
android:showAsAction="ifRoom"
android:title="@string/action_search"/>
</menu>