This gist is a workaround to this bug:
https://code.google.com/p/android/issues/detail?id=29472
No changes are needed to your current code but changing the extended fragment/activity class.
All you have to do is put this two classes in your code and make your activity extend MenuManagerActivity and your fragment MenuDelegatorFragment.
No change is needed to the actual fragment apart from the extended class. Using a Viewpager, Actionbar Tabs, Navigation Drawer (hamburger menu) on Android pre-4.4 Kitkat made the menu created from the fragments (or nested fragments) unreliable, meaning that switching between pages, changing fragments etc caused the menu not to update in sync with the currently showed fragment.
Resulting in options menu items being visible when their fragment was not or vice-versa.
This workaround delegate all the handling of the option menu to the activity that will call the fragments methods to create the menu.
The fragment side of the thing disable the framework handling and register / unregister the fragment to the activity when the fragment come in / go out from the current view, which cause an invalidate on the menu.
I don't know if work in 100% of the cases. But it works perfectly fine and reliably for me so I share it for everyone.
Let me know in comments if this worked for you. Suggestions are welcome!