我有一个自定义的 Gridview。在我的适配器中使用 AQuery 完成异步图像下载。图像已正确下载,但在某些情况下会发生错误,因此图像视图背景完全变白。我想设置该错误图像。
现在这是我在 gridView() 中的适配器的代码:
try{
String[] tmp_arr_thumb_img = prodItems.get(holder.position).getprod_image().split(global.split_seprator);
//String imageID = tmp_arr_thumb_img[0];
String thumbImg = tmp_arr_thumb_img[1];
if (aQuery.shouldDelay(holder.position, convertView, parent, global.GLOBAL_UPLOADED_PHOTOS_URL + thumbImg)){
aQuery.id(holder.imageView).image(R.drawable.no_image);
}else{
aQuery.id(holder.imageView)
.image(global.GLOBAL_UPLOADED_PHOTOS_URL + thumbImg,true,true,200,0, new BitmapAjaxCallback(){
@Override
protected void callback(String url, ImageView iv, Bitmap bm, AjaxStatus status) {
iv.setImageBitmap(bm);
}
}.animation(AQuery.FADE_IN));
}
}catch (OutOfMemoryError err){
err.printStackTrace();
}