The moose likes Android and the fly likes ListView getView() problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "ListView getView() problem" Watch "ListView getView() problem" New topic
Author

ListView getView() problem

Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
Hello friends,

I have a simple question for you. Lets assume I am taking one ListView in my Activity and I have made on Custom Adapter for it. I am extending Base Adapter for that.
Now that Custom Adapter is taking some ArrayList. Now for each item getView will be called that I know. But for some reason getView is calling more number of time then it should. Say if my arraylist is having 5 item. It should be called for 5 times only.
But it is being called 10-13 time. I really do not know why.


Please answer.

Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1365

Per Romain Guy, the person who wrote this class :
there is absolutely no guarantee on the order in which getView() will be called nor how many times.


Don't write code that makes assumptions that getView() would be called only once per row.


[List of FAQs] | [Android FAQ] | [My Blog] | [Samuh Varta]
 
 
subject: ListView getView() problem
 
Threads others viewed
Custom ListView in Fragments
calculate ImageView dimentions before user interact the UI
styling items of a ListView
How to refer a view in a line inside a ListView ?
How to use custom color for each textview in listview that extends SimpleAdapter in Android ?
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture