I have an activity showing a few fragments.
Activity view contains only ViewPager initialized with custom FragmentPagerAdapter.
This adapter provide navigation among 3 fragments
It can be done by implementing onCreateOptionsMenu and calling setHasOptionsMenu(true) in the onAttach callback in each fragment and change the actions accordingly.
To show the fragment without any actions setHasOptionsMenu(false) in it