Possible Duplicate:
Android: Strange out of memory issue while loading an image to a Bitmap object的OutOfMemoryError:位图大小超过VM预算: - 安卓
我是从网址下载图片并显示它们。在下载时,它给予out of memory error : bitmap size exceeds VM budget
。我使用drawable。代码如下:
HttpClient httpclient= new DefaultHttpClient();
HttpResponse response=(HttpResponse)httpclient.execute(httpRequest);
HttpEntity entity= response.getEntity();
BufferedHttpEntity bufHttpEntity=new BufferedHttpEntity(entity);
InputStream instream = bufHttpEntity.getContent();
Bitmap bm = BitmapFactory.decodeStream(instream);
Bitmap useThisBitmap = Bitmap.createScaledBitmap(bm,bm.getWidth(),bm.getHeight(), true);
bm.recycle();
BitmapDrawable bt= new BitmapDrawable(useThisBitmap);
System.gc();
以下是错误:05-28 14:55:47.251: ERROR/AndroidRuntime(4188): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
图像有多大? – 2010-05-28 09:54:10
嗨,, Marcelo Cantos !!! ..高度和图像的宽度= 320x320 – Andy 2010-05-28 10:09:28
找出你有多少种方式可以获取图像,以便你找不到内存问题 – 2010-05-28 10:23:13