i’m trying to learn Android and i don’t understand what Inflate really does; i’ve seen different examples on which it is used for inserting a layout inside another but i’m not sure on where it is good to be used.
Can anyone help with good examples?
Thanks and greetings
“Inflation” is a term that refers to parsing XML and turning it into UI-oriented data structures. You can inflate a view hierarchy, a menu structure, and other types of resources. Often this is done behind the scenes by the framework (when you call
setContentView(R.layout.main), for instance). A typical case when you explicitly inflate something yourself is when creating menus, as described in the guide subject Creating Menus.