In class HomeFragment : Fragment(R.layout.fragmenthome), the constructor argument:
- Sets the menu
- Starts a new activity
- Gives the layout that the fragment inflates automatically
- 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