What does the LayoutInflater attachToRoot parameter mean?

The LayoutInflater.inflate documentation isn’t exactly clear to me about the purpose of the attachToRoot parameter.

attachToRoot: whether the inflated hierarchy should be attached to the root parameter? If false, root is only used to create the correct
subclass of LayoutParams for the root view in the XML.

Could someone please explain in more detail, specifically what the root view is, and maybe show an example of a change in behavior between true and false values?

12 Answers
12

Leave a Comment