how to load image with Universal ImageLoader without displaying

匆匆过客 提交于 2019-12-03 08:55:49

Try this:

imageLoader.loadImage(url, new SimpleImageLoadingListener(){

                    @Override
                    public void onLoadingComplete(String imageUri, View view,
                            Bitmap loadedImage) {
                    super.onLoadingComplete(imageUri, view, loadedImage);

                        //write your code here to use loadedImage
                    }

                });

Here onLoadingComplete will be called on UI thread which makes it thread safe

You can not do any networking on the main thread. See for description. UIL usually creates the thread and stuff for you when you call displayImage, but loadImageSync does not. Either create a thread and load it or use an AsynTask.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!