I use Fragments and when I switch to nested Fragment, which implements public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
my menu inflates quantity o
Use before replace.
fragment = new EditMyProfile();
FragmentTransaction fragmentTransactionEditProfile =getSupportFragmentManager().beginTransaction();
getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
fragmentTransactionEditProfile.replace(R.id.frame, fragment);
fragmentTransactionEditProfile.commit();