Android : using universal image loader for listview

on Wednesday, October 1, 2014


I am using universal image loader to cash images from a url in a listview. There is an exception as below: My code to define imageloader:



ImageLoader imageloader;


imageloader.getInstance().init(ImageLoaderConfiguration.createDefault(getApplicationContext()));


My code to use a handler for image view:


holder.pic_path= (ImageView) findViewById(R.id.song_pic); imageloader.displayImage(pic_path[position], holder.pic_path);


My code to display image from url:


imageloader.displayImage(pic_path[position], holder.pic_path);


pic_path[position] is an array of urls.


And exception:



10-01 15:28:07.881 15256-15256/com.example.mediaplayer E/Zygote﹕ Zygote: error closing descriptor
libcore.io.ErrnoException: close failed: EBADF (Bad file number)
at libcore.io.Posix.close(Native Method)
at libcore.io.BlockGuardOs.close(BlockGuardOs.java:75)
at com.android.internal.os.ZygoteInit.closeServerSocket(ZygoteInit.java:221)
at com.android.internal.os.ZygoteConnection.handleChildProc(ZygoteConnection.java:879)
at com.android.internal.os.ZygoteConnection.runOnce(ZygoteConnection.java:242)
at com.android.internal.os.ZygoteInit.runSelectLoop(ZygoteInit.java:715)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
at dalvik.system.NativeStart.main(Native Method)

0 comments:

Post a Comment