In which fragment callback should you find buttons and set click listeners?

  1. onDestroyView()
  2. onViewCreated()
  3. onDetach()
  4. onAttach()
Answer

B) onViewCreated()

The view exists in onViewCreated().

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