Try recycling the unused bitmap. Not sure why do you need to store the all bitmaps in ArrayList.
There could be a memory leak. Analyse the memory usage of your application. Check here for more info ( http://android-developers.blogspot.com/2011/03/memory-analysis-for-android.html) . On Tue, Mar 29, 2011 at 6:07 PM, vani reddy <vani.redd...@gmail.com> wrote: > I am getting the outOfMemoryError,bitmap size exceeds the virtual machine > budget > > i am doing the below > > > public void getBitmap1(String str) > { > InputStream is =null; > try { > URL myFileUrl =new URL(str); > HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); > conn.setDoInput(true); > conn.connect(); > is = conn.getInputStream(); > Bitmap orgImg = BitmapFactory.decodeStream(is);//this line it is throwing > exception > barcode_bitmap.add(orgImg);// barcode_bitmap is an arraylist of bitmap. > } catch (IOException e) { > e.printStackTrace(); > } > finally{ > if(is!=null) > { > try { > is.close(); > } catch (IOException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > } > } > } > > How to resolve this, it comes once in a while. > Please help,Thanks in advance:-) > > -- > Regards, > Vani Reddy > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en