Hi,

I'm using lazy-loading for images in a listview. I'm reusing the views
using ViewHolder. The weird thing is, the first row and the last row
visible on the screen seem to have the same image(of the last row on
the screen).
I'm using SimpleCursorAdapter, and in bindView, I'm dispatching the
image load request to another thread, passing the ImageView reference,
so that it can be updated later, when the image is loaded. I also
tried passing the View reference of the row and updating its
ViewHolder's ImageView.

Also, I have noticed a strange behaviour of Android ListView. I wonder
if I need to put it as another forum question.
On setting the adapter, Here's what happens:

1. Step 1: (i) newView() for the 1st row is called.
               (ii) bindView() for the 1st row is called.
               (iii) bindView() is called for the rest of the visible
rows which reuse the 1st row's view.

2. Step 2: (i) bindView() for the 1st row is called reusing its
previous view (newView()).
               (ii) newView() is called for the rest of the visible
rows giving a new view to each of them.

3. Step 3: (i) Again, newView() for the 1st row is called.
               (ii) bindView() for the 1st row is called.
               (iii) bindView() is called for the rest of the visible
rows which reuse the 1st row's view.

I wonder why is it required. Has anyone else noticed it ??

SuperNova

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to