I\'m trying out the Google\'s new Volley library and it\'s looking sharp and loads images quickly when I use this method setImageUrl:
holder.ima
Another approach (similar to the code from @Simulant above) is to use use a regular ImageView in your xml and then make the image request using Volley.ImageRequest. If you use the Singleton pattern that is recommended by Google it would look something like this:
ImageView mImageView = (ImageView) findViewById(R.id.myimageview);
RequestQueue requestQueue = MyVolleySingleton.getInstance(mContext).getRequestQueue();
ImageRequest mainImageRequest = new ImageRequest(myImageURL,
new Response.Listener() {
@Override
public void onResponse(Bitmap bitmap) {
// set the image here
mImageView.setImageBitmap(bitmap);
// hide the spinner here
}
}, 0, 0, null, null);
requestQueue.add(mainImageRequest);
By the way: Make sure that you use a regular ImageView instead of the NetworkImageView or the image will not show properly.