1

Android: How to recreate Action bar when fragment changed

view story
linux-howto

http://stackoverflow.com – I have an activity showing a few fragments. Activity view contains only ViewPager initialized with custom FragmentPagerAdapter. This adapter provide navigation among 3 fragments. All seems to work fine except Action bar. I override onCreateOptionsMenu() method in my fragments to create individual Action bar for any fragment: @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); menu.clear(); //fragment specific menu creation } When I do swipe, new fragment appears, but Action bar s (HowTos)