This post is about Android. The following is what is happening:
I'm loading JSON and putting this into a ListView. Now, an item in this ListView is basically an ImageView and a TextView.
Because the ImageView's image can be up to 2MB large, I want to load the ImageView's Drawable async after loading the ListView (also done Async).
How should I do this? I already created 2 AsyncTasks, one for loading the list and another one for loading a Drawable based on URL. Both work, but I don't know how to inform the ListView that the Drawable is updated.
Currently, the Drawable shows when I scroll down and the item goes out of view. Then I scroll back and I see the image is updated. I think this is because I "set" the image in getView (ArrayAdapter) and this get's called when an item get's into view.
All data get's stored in an ArrayList of BlablaItem. Let's say BlablaItem contains "String title", "String imageUrl" and "Drawable image". Perfect would be to just update this Drawable in the class and that the ListView updates it too automatically...
So my question is how to do all this nicely, where to create my AsyncTask for the Drawable (currently in the loop to process JSON), where to create my AsyncTask (currently in the ArrayAdapter constructor) and how to signal the ListView that the Drawable has been updated.