Which transaction method swaps the current tab's fragment for a new one?

  1. add()
  2. replace()
  3. detach()
  4. hide()
Answer

B) replace()

replace() removes the current fragment in the container and adds the new one.

Computer Science MCQ · More Lab: Bottom Navigation with Fragments MCQs · Practise