somerandomusername somerandomusername - 1 year ago 160
Android Question

Cancel loading image with universal-image-loader

I have GridView with remote image in every block. When I scroll it as fast as possible it lags the first time. After that it has loaded every image and works smoothly. How can I cancel loading image for blocks that went off screen ?

Answer Source

If You are Using ViewHolder Pattern, UIL Handles it by itself and you Don't need to Cancel Loading Images for blocks that went off screen!

see this Part of Source Code

else if (isViewWasReused()) {
        listener.onLoadingCancelled(imageUri, imageAware.getWrappedView());

read more about ViewHolder Pattern

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download