问题
how to set my custom downloader? I cannot see a Builder method to change the downloader class.
I want use Google HTTP Client library and I have a subclass ready, like this:
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;
public class GoogleHttpDownloader extends BaseImageDownloader {
//constructors, etc...
@Override
protected InputStream getStreamFromNetwork(String imageUri, Object extra)
throws IOException {
//new instancce of client, connect, return stream
}
}
But, how to make UIL to use?
Thanks.
回答1:
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
...
.imageDownloader(new GoogleHttpDownloader())
...
.build();
ImageLoader.getInstance().init(config);
来源:https://stackoverflow.com/questions/17164340/how-set-custom-downloader-in-universal-image-loader