Volley加载图片 ImageLoader使用法
ImageLoader imageLoader = new ImageLoader(requestQueue,new ImageLoood());
ImageLoader.ImageListener imageListener = imageLoader.getImageListener(imageView,R.mipmap.ic_launcher,R.mipmap.ic_launcher);
imageLoader.get(strUrl,imageListener );
ImageRequest加载方法
ImageRequest request = new ImageRequest(strUrl, new Response.Listener<Bitmap>() {
@Override
public void onResponse(Bitmap response) {
imageView.setImageBitmap(response);
}
}, 0, 0, Bitmap.Config.RGB_565, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
imageView.setImageResource(R.mipmap.ic_launcher);
}
});
requestQueue.add(request);