Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Lists and Adapters (2015) Custom ListViews getView() and the ViewHolder Pattern

Anas Fahad
Anas Fahad
16,079 Points

what does LayoutInflater exactly do ?

Hi I really didn't understand what LayoutInflater is, also what is LayoutInflater.Factory is it related to Factory Design Pattern ?

Thanks :)

2 Answers

Yeeka Yau
Yeeka Yau
7,410 Points

The way I think about it is that it grabs that XML file we have set up and allows us to access the views that are contained in that layout.

If this is truly how it works, then by gum you are a master of explaining things my friend!

Yongshuo Wang
Yongshuo Wang
5,500 Points

Hi,

From my understanding, the LayoutInflater is used to layout a customized xml file into particular view. Such as the list_item.xml.

huh?