Skip to content Skip to sidebar Skip to footer

Doubts With Base Adapter Class And Its Functionality

I am trying for the customized list view, I am adding the list of objects using array list and i send it to the class that extends base adapter and when i extends the base adapte

Solution 1:

Adapter#getView is only called when the AdapterView requires a view. You should not make any assumptions about how frequently or how many times getView is called. The only thing getView should do is return the required view as quickly as possible.

Solution 2:

I placed a Log.d() in the getView() and noticed that getView() has been called 5 times. i.e. getView() is called for 5objects and therefore 5 Views are created. And this tutorial says if you have a billion items ,instead of billion Views are get created - views will be cached according to the size of the window.

Post a Comment for "Doubts With Base Adapter Class And Its Functionality"