Which call navigates to another destination with the Navigation component?

  1. replace(R.id.detail)
  2. setContentView(R.id.detail)
  3. startActivity(R.id.detail)
  4. findNavController().navigate(R.id.detailFragment)
Answer

D) findNavController().navigate(R.id.detailFragment)

NavController.navigate() moves between destinations.

Computer Science MCQ · More Windows Mobile, Eclipse and Fragments MCQs · Practise