Don't load your images in full (100%) size. Load them no larger (or maybe 
slightly larger) than the size of the screen (in pixels).
Take a look at this link:
http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html
 
and look at the 'inSampleSize' parameter: Set this to any value larger than 
1 (preferably powers of 2) to load smaller images.


On Monday, April 2, 2012 7:46:19 PM UTC-4, Farhan wrote:
>
> Hello everyone,
>
> I populate a list of image urls and pass it to a listAdapter. The getView 
> gets the 3 successive urls (from the list) for the position in list it is 
> called for, and downloads them, and adds it to a row of the list. The list 
> works fine. But when I click on a picture to fire an intent and show a 
> bigger picture (by modifying the url passed as intent extra), my 
> application crashes, saying that bitmap exceed memory. 
>
> I am pretty sure that an image can not be that big in size to take all 
> space from heap! Any suggestions on how to go about the issue? I need to 
> keep the images from the listView, so I can't remove them from the 
> imageViews when I go to the next activity. For the same reason, I can not 
> finish() my list activity too, when an image is clicked. I feel I am stuck 
> here. Any help is much appreciated
>

-- 
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

Reply via email to