In class HomeFragment : Fragment(R.layout.fragmenthome), the constructor argument:

  1. Sets the menu
  2. Starts a new activity
  3. Gives the layout that the fragment inflates automatically
  4. Names the host activity
Answer

C) Gives the layout that the fragment inflates automatically

Passing the layout ID lets Fragment inflate it without overriding onCreateView.

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