code: public void replace(Fragment fragment) {
          manager.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
          manager.beginTransaction()
              .replace(containerId, fragment, indexToTag(0))
              .commit();
          manager.executePendingTransactions();
      }
docs: Replaces stack contents with just one fragment.