• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps ListView Bug in Emulator?

safibaba

Newbie
When I populate a ListView in the emulator, it seems fine until it reaches enough items to require scrolling. After that, it starts to repeat items and place them in any old order instead of in the order they appear in the ArrayAdapter.

Just wondering if anyone has come across this - if I use the Log to check the contents of the ArrayAdapter, the data is as expected, but in the ListView items are getting repeated. Is it me or the emulator?
 
Does your code work on a device?

I've had that issue; it was caused by me not properly recycling convertView in getView().
 
Hi Dmitri

Sadly..my HTC Hero is being repaired under warranty, and I have no real device to test on... :(

Could you explain about recycling convertView? I think maybe this is the problem... I am using my own Adapter to create the views..maybe I have done soemthing wrong.
 
I don't know if I can really explain. It was my first ListView and I didn't really know what I was doing. All I remember now is that I screwed it up, it was failing in a very strange way, and it took me forever to fix it.

If you post some code - specifically the getView() function in your adapter - I could take a look and see if there's something obviously wrong with it.
 
Back
Top Bottom