1

I create a Bitmap using Android Query like this:

ArrayList<Bitmap> bitmapArray = new ArrayList<Bitmap>();
aq = new AQuery(HomeCategoryActivity.this);
aq.ajax(currentUrl,Bitmap.class,0,new AjaxCallback<Bitmap>(){
    @Override
    public void callback(String url, Bitmap object, AjaxStatus status) {
            if(object != null)
            {
                bitmapArray.add(object);
            }
    }
});

But when I Log.d the size of the arraylist, it returns 0. The Bitmap is NOT NULL, I checked by setting it as an image resource. It simply doesn't get added to the arraylist. What do you think is wrong?

  • Where are you performing the Log? It sounds like AQuery is recycling the bitmap. Try making a copy of the Bitmap and see if it still returns the same size. – RocketSpock Jan 19 '15 at 21:00
  • 1
    You might also be logging the size before the request is done (before your callback is called). – user253751 Jan 19 '15 at 21:19

0 Answers0