AndroidWebImageView droid-fu in a ListView

244 Views Asked by At

I have a Listview where I have imageviews which load a custom url. I've the problem that one loaded ressource loads again, and so it hangs when scrolling up and down because every time the ressources will be reloaded.

First with only one View Type in the listview, I called a reset() on the webView, but there were some images that didn't load the correct url. So I tried to return the row count for the typeCount and the position vor the viewType:

getViewTypeCount () returns table.length(); //the same as getCount()

getItemViewType (int position) returns position;

It works for the first 15 rows. Images didn't get reloaded after scrolling down and up. This is the right behaviour. But when I add some lines and return another count (because table.length() has been updated the App crashes because of an ArrayIndexOutOfBoundException in a UI Element.

Then I tried to return to getItemViewType (int position) the constant: IGNORE_ITEM_VIEW_TYPE. This fixed the issue, of the images, in every row is now the right Image, but while scrolling down and up it reloads the last images. Is there a way how I can fix this?

The loadImage() on the droid-fu WebImageView I call only at the moment if the convertView == null.

1

There are 1 best solutions below

0
On BEST ANSWER

According to this, development on Droid-Fu is going to stop and it will be 'rebranded' as Ignition.

Ignition has a similar class called RemoteImageView. Usage is basically the same but it appears they've reworked the back end a bit. I tried it with a ListView that was giving the loading forever problem. Worked for me (although it introduced some other problems). Performance is better as well i.e. once loaded the images load quicker on scrolling the list.