Today I was struggling with the same problem. Since there is no answer, I'd like to share mine, hoping that would be helpful for someone.
Checking out the NetworkImageView source code, I found out that the "problem" was here:
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
loadImageIfNecessary(true);
}
So, just because I didn't want touch this awesome framework, I created a SpinnerNetworkImageView
(copy and paste from the original NewtworkImageView) customizing this method:
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
loadImageIfNecessary(false); // <-- look @ 'false'
}
Now everything works fine.
Another way will be to use a normal ImageView and performing an ImageRequest in your adapter:
Response.ErrorListener errorListener = ...
Response.Listener<Bitmap> listener = new Response.Listener<Bitmap>() {
@Override
public void onResponse(Bitmap bitmap) {
holder.picture.setImageBitmap(bitmap);
}
};
ImageRequest req = new ImageRequest(
url, listener, width, height, Config.ARGB_8888, errorListener);
requestQueue.add(request);
but I choosed the first solution.