Fill the place of fragment B with an empty FrameLayout. On button click, add the fragment B to that Framelayout (Create it)
public void atButtonClicked()
{
FragmentB b = new FragmentB();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.add(R.id.fragmeLayout, b);
transaction.commit();
}