Reputation: 4927
I can not find a good answer for setting an imageview inside a listview
I am using asynctask to get the images.
I am using an arrayadapter for my list view.
In my array adapter in getView i set the id of the view to my object id.
As the fetched images return from the server I do the following to update the view with the image.
private void populateListImage(Bitmap bitmap, long id) {
View view = m_findByRegionList.findViewById((int) id);
if (view != null) {
ViewHolder viewHolder = (ViewHolder) view.getTag();
viewHolder.image.setImageBitmap(bitmap);
}
}
1st problem: This is really slow.
2nd problem: setting the view id to my object id must be wrong
Upvotes: 0
Views: 736