Hey @kartiksinghal0198
To clarify your doubts, ViewGroup essentially refers to all the Layouts we have (LinearLayout, FrameLayout, RelativeLayout, etc.)
The special thing about ViewGroups is that unlike Views, they can contain more views inside them.
Parent is nothing but a variable name that is of the type ViewGroup.
the iflate()
method takes in 3 parameters, 1st if the layout which we need to inflate.
The second parameter is an already existing viewgroup or layout inside which this inflated layout will go to.
The third parameter is a boolean, which if set to true, will immediately add the inflated layout to our viewgroup.
A lot of android framework APIs handle adding the inflated layout to viewholder automatically, so we pass false in here.
Some of the examples of these APIs are Adapters and Fragments.
Best!