【发布时间】:2012-01-15 08:22:35
【问题描述】:
我正在尝试使用以下代码在 ImageView 中从 Internet 加载图像:
public Bitmap getBitmap(String bitmapUrl) {
try {
URL url = new URL(bitmapUrl);
return BitmapFactory.decodeStream(url.openConnection().getInputStream());
}
catch(Exception ex) {
return null;
}
}
它在 Android 2+ 上运行良好,但在 Ice Cream Sandwich 上失败,没有错误,只是没有显示图像(我正在使用模拟器 btw)。有什么想法有什么问题吗?...非常感谢!
【问题讨论】: