Adapting ListView adapter with an ImageLoader Class in Android

后端 未结 1 1680
渐次进展
渐次进展 2020-12-22 05:05

I have a custom ListView adapter which implements an ImageThreadLoader class. Unfortunately, the class doesn\'t enable a cache option-download the images from the web and sa

相关标签:
1条回答
  • 2020-12-22 05:28

    I posted code in this Code for Image Loader..

    Check that code ..

    1.In your Activity get all the images URL in String Array and pass it..

    dealAdapter = new LazyAdapter(Activityname.this,VALUE_image);
    

    where VALUE_image contains your images.

    Important thing is that check whether you add permission in Manifest file

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    

    Create a file namelyImageLoader.class and paste the code of Image Loader given in that link

    Then create file namely Utils.class and paste code of Utils in that link.

    In the above code it checks whether Sdcard is present if so the create folder in Sdcard and store all images in compressed format and retrive it later..

    Else if no it store images in Cache memory..

    First time its load image from the server and next time it check whether it is in Sdcard or in Cache Memory if so retrive the image and Displays..

    Check it..

    0 讨论(0)
提交回复
热议问题