android - Recycler view with volley image request (cancel request) -


textprint = "text" after "itemprop =" text ">

Then I am using recycler footage using the volley library as the bitmap images and images in a grid from the image To be shown.

Public Weed Abandoned Holder (Last Trending Adapter. ViewHolderHolder, Int Eye) {ImageRequest Request = New ImageViewWise (URL, New Response. Listener & lt; Bitmap> () {@ Override Public Wide On Response (bitmap bitmap) {ifHolder.getmImageView} setImageBitmap (bitmap) ;.}}}, 0, 0, null, new Response.ErrorListener () {@Override Public Zero onErrorResponse () VolleyError volleyError) {}}); . AppController.getInstance () addToRequestQueue (request); }

The problem is when I scroll down and leave one or more views before the picture is downloaded and that scene rewrote the image rewrite the reqest cancel on the resulting view in a flash of those intermediates It has not been / that image (images) loaded in that scene before the actual image

so I thought about canceling those intermediate image requests using the tag, but this So can not see how it cancels the request in parallel scenes!

In addition, when I use the volley network imageview (which automatically rejects such image itself) gives the correct result. But I need to take the color from every image bitmap so that I can not use NetworkImageView.

Q: How do I cancel all vertical volley images requsts (without leaving one and without affecting other parallel scenes) on the inflated special image view using recycling?

After

you should use ImageLoader instead of directly < The class to add a request for the code> RequestQueue . In this way, when returning the to obtain the images, the method will return an object of "ImageContainer .

Save it to ImageContainer in ViewHolder , and when a view is recycled, simply click on the recycled image to cancel the request. > CancelRequest () Call the method, if not yet has been done.

Take a look at the code of NetworkImageView . It works in a similar way.


Comments