• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps What does inflate do?

#4+.. which then enables you to have some kind of templates created in layout XML's which you can, programatically, add anywhere you want them, from generic data.

Say you have an app where users can add different notes to something and you want a button to add a new field for input. Then you could have a userinput.xml that specifies just that part of the layout, taking care of positions, pictures, headers, whatever. And then you just inflate them and add them to a parent view, e.g. a LinearLayout...
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones