我正试图在ImageView中显示来自Internet的图像。
这就产生了以下错误,任何人都会引导我在这里犯什么错误
公共位图displayLiveImage(字符串imagesrc)
{
位图BM;
尝试{
URL aURL = new URL(ImageSrc);
URLConnection conn = aURL.openConnection();
conn.connect();
InputStream is = null;
try
{
is= conn.getInputStream();
}catch(IOException e)
{
return null;
}
BufferedInputStream bis = new BufferedInputStream(is);
bm = BitmapFactory.decodeStream(bis);
bis.close();
is.close();
} catch (IOException e) {
return null;
}
return bm;
}
洛卡特
11-12 21:45:22.509: ERROR/AndroidRuntime(7118): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-12 21:45:22.509:
ERROR/AndroidRuntime(7118): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
11-12 21:45:22.509:
ERROR/AndroidRuntime(7118): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:476)
11-12 21:45:22.509:
ERROR/AndroidRuntime(7118): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:537)
11-12 21:45:22.509:
ERROR/AndroidRuntime(7118): at com.Finditnear.FindItNearActivityWithoutMenu.DisplayLiveImage
(FindItNearActivityWithoutMenu.java:149)
11-12 21:45:22.509: ERROR/AndroidRuntime(7118): at com.Finditnear.ViewSingleImage$1.run
(ViewSingleImage.java:88)
任何帮助都将不胜感激。