//Volley里面提供一个组件可以用来显示Image NetWorkImageView
private void getNetImage() {
RequestQueue requestQueue = Volley.newRequestQueue(MainActivity.this);
ImageLoader imageLoader = new ImageLoader(requestQueue, new ImageLoader.ImageCache() {
@Override
public Bitmap getBitmap(String url) {
Log.e("url", url);
return null;
}
@Override
public void putBitmap(String url, Bitmap bitmap) {
Log.e("putBitmap", url);
}
});
mNet.setDefaultImageResId(R.mipmap.iv_lol_icon3);
mNet.setErrorImageResId(R.mipmap.iv_lol_icon14);
mNet.setImageUrl(ImageUrls.imageUrls[8], imageLoader);
}
}
网友评论