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); On Tue, Nov 11, 2008 at 8:14 PM, Obormot <[EMAIL PROTECTED]> wrote: > > Hi, guys. > > I load Drawables (jpeg pictures) from URLs the following way: > URL urlO = new URL(url); > URLConnection urlC = urlO.openConnection(); > InputStream is = urlC.getInputStream(); > return Drawable.createFromStream(is, url); > > It's funky that sometimes it returns null and sometimes some > incompletely loaded drawable. > I see the following errors in the log: > > 11-11 22:01:41.693: DEBUG/skia(1314): xxxxxxxxxxxxxx failure to skip > request 3954 actual 3372 > 11-11 22:01:41.693: DEBUG/skia(1314): xxxxxxxxxxx jpeg error 91 > Miscellaneous marker 0x%02x, length %u > > As I understand Drawable is somehow asynchronously loaded. > How would you recommend me go around this issue? I use those drawables > for example as markers on the map. > > > -- Romain Guy www.curious-creature.org --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---