Use the BitmapFactory.Options to create the images.
In the BitmapFactory.Options, you can scale your image so that it will
consume low memory.

On Jul 30, 11:50 am, Ed <[email protected]> wrote:
> if you are hanging onto a copy of the images have a look at
> SoftReference e.g.
>
> SoftReference<Bitmap> myImage;
>
> This will automatically handle releasing the Bitmap if it's not in use
> or is taking up too much room.
>
> If you have a set of images the best approach is a hash map where the
> url of the image is the key.
>
> This might help 
> -http://code.google.com/p/android-pinch/source/browse/trunk/src/com/ni...
>
> Also try some housekeeping things like closing any streams.
>
> Ed
>
> On Jul 30, 12:42 am, Sohan badaya <[email protected]> wrote:
>
>
>
> > Hi All,
>
> > I wrote a application that load images from facebook and i show in
> > lmageview, using this below code.
>
> >                                 InputStream object = myDataFromServer;
> >                                 Bitmap 
> > bmpImage=BitmapFactory.decodeStream(object);
> >                                 imageView.setImageBitmap(bmpImage);
>
> > it works fine for me. But the trouble is when i run my application for
> > a longer time, it gives me error,
> > OutofMemoryError, and becuse of this error my application crash.
>
> >       so want to know is there any better way to handling
> > images.please help me.
>
> > Thanks,
> > Sohan Badaya

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to