ListView Bug in Emulator?


Last Updated:

  1. safibaba

    safibaba Member This Topic's Starter

    Joined:
    May 3, 2010
    Messages:
    15
    Likes Received:
    0
    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?
     

    Advertisement
  2. dmitriyk

    dmitriyk Active Member

    Joined:
    Apr 17, 2010
    Messages:
    44
    Likes Received:
    10
    Does your code work on a device?

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

    safibaba Member This Topic's Starter

    Joined:
    May 3, 2010
    Messages:
    15
    Likes Received:
    0
    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.
     
  4. dmitriyk

    dmitriyk Active Member

    Joined:
    Apr 17, 2010
    Messages:
    44
    Likes Received:
    10
    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.
     

Share This Page

Loading...