On Jun 26, 5:59 pm, Mark Murphy <[email protected]> wrote:
> Peter wrote:
> > Sorry. I'm making the mistake of hoping people identify the problem
> > based on not very much information, partially because I'm lazy, I
> > guess.
>
> I may also simply be a bit thick.
>
> > Row 0 in the ListView contains an ImageView. Initially, all rows have
> > a placeholder image. The thread updates row 0's ImageView
>
> "The thread"?
Well, the thread sends a message to a Handler. Incidentally, the
Handler is what kicks off the icon-grabbing thread as well. I am using
a similar pattern to this: http://tinyurl.com/p5hlxz (Android source
link).
>
> That better be "the UI thread". Anything else should blow up and would
> be unreliable if it somehow doesn't blow up. Always update your UI via
> the UI thread.
>
> So, for example, if you use AsyncTask for your data fetch and UI update,
> you would do the HTTP operations in doInBackground() and update the list
> in onPostExecute().
I am doing the equivalent of that, as far as I can tell.
>
> > and I see
> > the image updated on the screen. A split-second later, row 5's image
> > is the same as row 0. So now, 0 has the new image, 1-4 still have the
> > placeholder, and 5 shows the image associated with row 0.
>
> That is pretty strange.
>
> Have you either used Eclipse breakpoints or Log statements to see when
> getView() is called? In the pattern you're describing here, how many
> times is it called?
>
> --
> Mark Murphy (a Commons
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Development Wiki:http://wiki.andmob.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---