在onCreate事件我做一个异步请求Facebook的API:更新的ImageView的Android
Utility.mAsyncRunner.request(null, params1,
new myListener());
在myListener的公司的onComplete事件中,我想设置图像中的ImageView
public class PhotoDisplayListener extends BaseRequestListener {
@Override
public void onComplete(final String response, final Object state) {
//set my image with the url provided in the response
...parse json....
ImageView img = (ImageView)findViewById(R.id.img);
URL ulrn = new URL(photourl);
HttpURLConnection con = (HttpURLConnection)ulrn.openConnection();
InputStream is = con.getInputStream();
Bitmap bmp = BitmapFactory.decodeStream(is);
if (null != bmp){
img.setImageBitmap(bmp);
setImage(bmp);
}
else
System.out.println("The Bitmap is NULL");
}catch(Exception e){} catch (FacebookError e) {
// TODO Auto-generated catch block
e.printStackTrace();
showToast(e.getMessage());
}
}
}
问题是imageview没有刷新我设定的新图片。 它设置它,它不会刷新它。如果我锁定并解锁手机,则图像应该显示。 我该如何强制刷新imageview? 谢谢!
它不见了404 :( – dinigo 2012-10-02 22:26:32
@ demil133我刚更新了链接,希望它有帮助 – SERPRO 2012-10-03 08:57:41