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.
Hello !
I'm experiencing exactly the same problem (working every time while
debugging with breakpoints; sometimes failing while normally running),
on Android 1.5
Did you solve this problem ?
Anthony
On Oct 3, 6:09 am, RoryD <rory1doug...@gmail.com> wrote:
> 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:
> 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.
I'm having a similar problem where BitmapFactory.decodeStream() is
working reliably in the emulator, but the same app transferred to the
phone is returning null everytime.
Any ideas?
Kevin Hooke
On Oct 14, 5:10 pm, "anthony.dahanne" <anthony.daha...@gmail.com>
wrote:
> Hello !
> I'm experiencing exactly the same problem (working every time while
> debugging with breakpoints; sometimes failing while normally running),
> on Android 1.5
> Did you solve this problem ?
> Anthony
> On Oct 3, 6:09 am, RoryD <rory1doug...@gmail.com> wrote:
> > 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:
> > 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.
> I'm having a similar problem where BitmapFactory.decodeStream() is
> working reliably in the emulator, but the same app transferred to the
> phone is returning null everytime.
> Any ideas?
> Kevin Hooke
> On Oct 14, 5:10 pm, "anthony.dahanne" <anthony.daha...@gmail.com>
> wrote:
> > Hello !
> > I'm experiencing exactly the same problem (working every time while
> > debugging with breakpoints; sometimes failing while normally running),
> > on Android 1.5
> > Did you solve this problem ?
> > Anthony
> > On Oct 3, 6:09 am, RoryD <rory1doug...@gmail.com> wrote:
> > > 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:
> > > 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?- Hide quoted text -
> Without (sample) code or a log-trace, there is not much that we can do
> to help you.
> On Oct 20, 11:44 am, "kevin.hooke" <kevin.ho...@gmail.com> wrote:
> > I'm having a similar problem whereBitmapFactory.decodeStream() is
> > working reliably in the emulator, but the same app transferred to the
> > phone is returning null everytime.
> > Any ideas?
> > Kevin Hooke
> > On Oct 14, 5:10 pm, "anthony.dahanne" <anthony.daha...@gmail.com>
> > wrote:
> > > Hello !
> > > I'm experiencing exactly the same problem (working every time while
> > > debugging with breakpoints; sometimes failing while normally running),
> > > on Android 1.5
> > > Did you solve this problem ?
> > > Anthony
> > > On Oct 3, 6:09 am, RoryD <rory1doug...@gmail.com> wrote:
> > > > 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:
> > > > 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?- Hide quoted text -
> I was having the same problem. It stoped when i gave the images i was
> loading the header Content-Length.
> Hope this helps.
> On 21 Oct, 14:13, Streets Of Boston <flyingdutc...@gmail.com> wrote:
> > Hi everyone,
> > Without (sample) code or a log-trace, there is not much that we can do
> > to help you.
> > On Oct 20, 11:44 am, "kevin.hooke" <kevin.ho...@gmail.com> wrote:
> > > I'm having a similar problem whereBitmapFactory.decodeStream() is
> > > working reliably in the emulator, but the same app transferred to the
> > > phone is returning null everytime.
> > > Any ideas?
> > > Kevin Hooke
> > > On Oct 14, 5:10 pm, "anthony.dahanne" <anthony.daha...@gmail.com>
> > > wrote:
> > > > Hello !
> > > > I'm experiencing exactly the same problem (working every time while
> > > > debugging with breakpoints; sometimes failing while normally running),
> > > > on Android 1.5
> > > > Did you solve this problem ?
> > > > Anthony
> > > > On Oct 3, 6:09 am, RoryD <rory1doug...@gmail.com> wrote:
> > > > > 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:
> > > > > 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?- Hide quoted text -