【发布时间】:2015-07-22 11:14:56
【问题描述】:
我正在使用以下方法从 url 中检索位图并将其传递给 imageview ,但 imageview 没有被更新。
public static Bitmap LoadImageFromWebOperations(String url) {
Bitmap bitmap;
try {
InputStream is = new URL(url).openStream();
bitmap = BitmapFactory.decodeStream(is);
return bitmap;
} catch (Exception e) {
return null;
}
打电话——
mov1_poster.setImageBitmap(VPmovies.LoadImageFromWebOperations(mov_details[0][7]));
//doesn't work
Toast.makeText(this,"url is \n"+mov_details[0][7],Toast.LENGTH_LONG).show();
// shows the url of the image successfully (just to check the url is not null)
我做错了什么吗?请帮忙。
【问题讨论】:
标签: android url bitmap bitmapfactory