Romain,

What is the bug number for this?  Was it fixed in the 1.0 r2 SDK?

- Cheryl

On Nov 12, 7:25 am, blindfold <seeingwithso...@gmail.com> wrote:
> Interesting. In case this Android bug/feature not only applies to
> input streams, this might also explain why I no longer had memory
> related crashes on the G1 after recently switching to using
> BitmapFactory.decodeResource(getResources() instead of getResources
> ().getDrawable() to retrieve background images from my resources.
>
> Regards
>
> On Nov 12, 5:30 am, Romain Guy <romain...@google.com> wrote:
>
> > This is a known bug. Here is a workaround:
>
> >                     in = new BufferedInputStream(new
> > URL(getUrl(size)).openStream(),
> >                             IO_BUFFER_SIZE);
>
> >                     final ByteArrayOutputStream dataStream = new
> > ByteArrayOutputStream();
> >                     out = new BufferedOutputStream(dataStream, 
> > IO_BUFFER_SIZE);
> >                     copy(in, out);
> >                     out.flush();
>
> >                     final byte[] data = dataStream.toByteArray();
> >                     bitmap = BitmapFactory.decodeByteArray(data, 0,
> > data.length);
>
>
--~--~---------~--~----~------------~-------~--~----~
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