views:

91

answers:

0

Hi

I was following the method for asynchronously loading images into a listview as outlined in evan charlton's blog here. The problem I am having is that the setViewImage function is not being called by the system:

@Override
public void setViewImage(final ImageView image, final String value) {
    if (value != null && value.length() > 0 && image instanceof RemoteImageView) {
        RemoteImageView riv = (RemoteImageView) image;
        riv.setLocalURI(API.getCacheFileName(value));
        riv.setRemoteURI(value);
        super.setViewImage(image, R.drawable.icon);
    } else {
        image.setVisibility(View.GONE);
    }
}

I have built his example code, and setViewImage is called fine - it seems to me that the code is functionally identical. Looking into the docs it says:

First, if a SimpleAdapter.ViewBinder is available, setViewValue(android.view.View, Object, String) is invoked. If the returned value is true, binding has occured. If the returned value is false and the view to bind is a TextView, setViewText(TextView, String) is invoked. If the returned value is false and the view to bind is an ImageView, setViewImage(ImageView, int) or setViewImage(ImageView, String) is invoked. If no appropriate binding can be found, an IllegalStateException is thrown.

I don't really understand how to debug (in eclipse) to find out how this process is occuring, advice on how to do so would be a help. Thanks.