转载自:http://hao.jobbole.com/glide/
Glide默认请求是用Android系统的HttpUrlConnection, 也可以切换网络请求方式为Volley和OKHttp:
1.切换为Volley
dependencies {
compile 'com.github.bumptech.glide:volley-integration:1.0.+'
compile 'com.mcxiaoke.volley:library:1.0.+'
}
2.OKHttp
dependencies {
compile 'com.github.bumptech.glide:okhttp-integration:1.0.+'
compile 'com.squareup.okhttp:okhttp:2.0.+'
}
3.最后需要在Activity中注册为你所用的网络请求
public void onCreate() {
Glide.get(this).register(GlideUrl.class, InputStream.class,
new OkHttpUrlLoader.Factory(yourOkHttpClient));
...
}