这里getTag出来值为null,这句if会出错
这里getTag出来值为null,这句if会出错
这里getTag出来值为null,这句if会出错
2016-06-17
private class NewsAsyncTask extends AsyncTask<String, Void, Bitmap> {
private ImageView mimageView;
private String zurl;
public NewsAsyncTask(ImageView imageView,String url)
{
mimageView=imageView;
zurl=url;
}
/*
执行后台操作
*/
@Override
protected Bitmap doInBackground(String... params) {
return getBitmapFromURL(params[0]);
}
@Override
protected void onPostExecute(Bitmap bitmap) {
if (mimageView.getTag().equals(zurl)) {
mimageView.setImageBitmap(bitmap);
}
}
}
举报