The safest place to find views and set listeners in a fragment is:

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

D) onViewCreated()

onViewCreated() runs after the view hierarchy is created.

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