How to make a lazy load of images in ListView in Android - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to make a lazy load of images in ListView in Android

Jeson84Jeson84 USAPosts: 90Member

I plan to use a ListView in Android to load a set of images from a website. Is there a way to make a lazy load of images in ListView?

Tagged:

Comments

  • DavidMDavidM USAPosts: 342Member
    edited January 2014

    Use Universal Image Loader open source library.

    From the project page:

    This project aims to provide a reusable instrument for asynchronous image loading, caching and displaying. It is originally based on Fedor Vlasov's project and has been vastly refactored and improved since then.

    Features

    • Multithread image loading
    • Possibility of wide tuning ImageLoader's configuration (thread executors, downloader, decoder, memory and disc cache, display image options, and others)
    • Possibility of image caching in memory and/or on device's file system (or SD card)
    • Possibility to "listen" loading process
    • Possibility to customize every display image call with separated options
    • Widget support
    • Android 2.0+ support
  • rajatghairajatghai delhiPosts: 1Member
    edited January 18

    I want to add images in my listview.
    Custom adpater
    `
    LayoutInflater inflater=activity.getLayoutInflater();

        if(convertView == null){
    
            convertView=inflater.inflate(R.layout.colmn_row, null);
    
            txtFirst=(TextView) convertView.findViewById(R.id.name);
            txtSecond=(TextView) convertView.findViewById(R.id.gender);
            txtThird=(TextView) convertView.findViewById(R.id.age);
            txtFourth=(TextView) convertView.findViewById(R.id.status);
    
        }
    
        HashMap<String, String> map=list.get(position);
        txtFirst.setText(map.get(FIRST_COLUMN));
        txtSecond.setText(map.get(SECOND_COLUMN));
        txtThird.setText(map.get(THIRD_COLUMN));
        txtFourth.setText(map.get(FOURTH_COLUMN));
    
        return convertView;
    

    `
    How can i implement an adapter so that i can add images to it? I have added the adapter through android multicolumn listview tutorial. Also i want to do lazy loading of images in listview. Please tell me how can i do that?
    Thanks in advance.

Sign In or Register to comment.