Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

ListView getView() problem

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic