Junaid
Junaid

Reputation: 336

how can we apply lazy loading on relative layout background image in android

I am working with relative layout. I am getting data from server and changing the relative layout background by using layout.set Background();. but in array adapter my list got stuck. So i want to apply lazy loading. on it. is there any way to using picasso or UniveralImageLoader to change background image of relative layout in android. if any please help me for this.

Upvotes: 0

Views: 129

Answers (1)

Ani
Ani

Reputation: 1061

You can do that UniversalImageLoader. Check for its documentation here.

https://github.com/nostra13/Android-Universal-Image-Loader

You can use this method and its callback to apply background with loaded bitmap.

imageLoader.loadImage(imageUri, new SimpleImageLoadingListener() {
    @Override
    public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
        // Do whatever you want with Bitmap
    }
});

Upvotes: 2

Related Questions