When I used some nested fragments for my application, child fragment of the application cannot add new option menu by overriding onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) method(never hit this method).
Class hierarchy of application is as follow.
MainActivity.java(extends SherlockFragmentActivity) (MainActivity include the following child fragments)
Fragment1.java(extends SherlockFragment)
Fragment2.java(extends SherlockFragment)
(Fragment2 include FragmentTabHost for adding following child fragments)
i. ChildFragment1.java(extends SherlockFragment)
ii. ChildFragment2.java(extends SherlockFragment)
iii. ChildFragment3.java(extends SherlockFragment)
I can add new OptionMenu in Fragment1, Fragment2 by adding setHasOptionsMenu(true) in onCreate(Bundle savedInstanceState) and by overriding onCreateOptionsMenu(Menu menu, MenuInflater menuInflater)
But I cannot add new OptionMenu in ChildFragment1, ChildFragment2, ChildFragment3 because onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) method of child fragment classes are never called.