Romain,

Can you please give details on the exact problem with the current 1.0
SDK? Should we avoid Drawables completely in favor of setting resource
id's or bitmap objects?  Or is the problem specific to a use case like
loading remote images (via URL)?  Based on the comment above that
BitmapFactory.decodeResource(getResources()...) behaves better than
getResources().getDrawable() I am assuming local images are
problematic as well?

Thanks!!
Cheryl

On Dec 15, 4:46 pm, Romain Guy <romain...@google.com> wrote:
> It wasn't fixed in 1.0r2. We cannot put fixes in the SDK if they are
> not available on the phones. Also, the bug is internal, it's not on
> the external tracker.
>
>
>
> On Mon, Dec 15, 2008 at 11:30 PM, Cheryl Sedota <cherylsed...@gmail.com> 
> wrote:
>
> > 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);
>
> --
> Romain Guy
> Android framework engineer
> romain...@android.com
>
> Note: please don't send private questions to me, as I don't have time
> to provide private support.  All such questions should be posted on
> public forums, where I and others can see and answer them
--~--~---------~--~----~------------~-------~--~----~
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