I have an activity which performs an image search, the results (URLs
of thumbnails on the web) are rendered in a GridView.

My GridView adapter class delegates creating the actual Bitmaps to an
AsyncTask that loops to sequentially fetch the image content from each
URL using HTTPClient, and creates the Bitmaps using:

BitmapFactory.decodeStream(entity.getContent()).

I found that the above method sometimes returns "null" silently
instead of creating a Bitmap.   The occurrences appear to correlate
with larger stream sizes (I check this by logging
entity.getContentLength()).  However, if I put a breakpoint just prior
to the decodeStream call & then resume immediately every time I hit it
(i.e. pause briefly on each iteration), the Bitmaps are created
perfectly every time.

All the images are quite small (most <10K), so the download &
decodeStream happens fairly quickly.  There are never more than 10
images processed in one AsyncTask.

Any ideas on what's going wrong?

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