Custom Adapter Where to inflate

27 Views Asked by At

I have seen multiple code, where On one hand some inflate in constructor and assign to global variable ,on the other hand ,others inflate in getView() method .

So how the performance changes ,which way is better ?

In first option we have global variable but in second option it will inflate every time getView() called.

1

There are 1 best solutions below

0
OneDev On BEST ANSWER

ViewHolder Pattern is the best way to implement list view in android. inflate the view for entire device screen and recycle element.