See the JavaDoc of the method public View inflate(int resource, ViewGroup root)
:
Inflate a new view hierarchy from the specified xml resource. Throws
InflateException if there is an error.Parameters
resource ID for an XML layout resource to load (e.g., R.layout.main_page)
root Optional view to be the parent of the generated hierarchy.Returns
The root View of the inflated hierarchy. If root was supplied, this is the root View; otherwise it is the root
of the inflated XML file.