• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ListView getView() problem

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic