I have a representation of the main part, with both basic and detailed fragments with my menu items on the action bar; the wizard has some, and there are some in the details, but the item data item element does not call onOptionsItemSelected when clicked. This problem is on the tablet.
On the other hand, if the same code is run on the telephone emulator, the elements of the action bar of the detailed view work without problems.
menu.xml
<item android:id="@+id/save_menu" android:icon="@drawable/ic_checkmark_holo_light" android:showAsAction="always|withText" android:title="Save"> </item> <item android:id="@+id/cancel_menu" android:icon="@drawable/ic_menu_close_clear_cancel" android:showAsAction="always|withText" android:title="Cancel"> </item>
The supercharger works fine, and both fragments in the main view of the part have setHasOptionsMenu(true); in their onCreate method.
EDIT
onCreateOptionsMenu in fragment activity
@Override public boolean onCreateOptionsMenu(Menu menu) { return super.onCreateOptionsMenu(menu); }
onCreateOptionsMenu in the main snippet
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.itemlistactivity_menu, menu); }
onCreateOptionsMenu in detail fragment
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.addfragment_menu, menu); super.onCreateOptionsMenu(menu, inflater); System.out.println("onCreateOptionsMenu called"); }