Possible Duplicate:
Android: Strange out of memory issue while loading an image to a Bitmap objectOutOfMemoryError: tamaño de mapa de bits supera el presupuesto VM: - Android
estoy descargando imágenes desde URL y de mostrarlos. En el momento de la descarga, está dando out of memory error : bitmap size exceeds VM budget
. Estoy usando dibujable. Código es el siguiente:
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();
Aquí está el error: 05-28 14:55:47.251: ERROR/AndroidRuntime(4188): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
¿Qué tan grande es la imagen? –
Hola, Marcelo Cantos !!! ..height & width of image = 320x320 – Andy
Averigüe de cuántas maneras puede obtener las imágenes para que no encuentre el problema de memoria –