Android decoder->decode returned false for Bitmap download

前端 未结 7 1697
不知归路
不知归路 2020-11-30 06:02

I\'ve started getting a

DEBUG/skia(xxxx): --- decoder->decode returned false 

issue on a few profile images from Facebook that I use in

7条回答
  •  悲哀的现实
    2020-11-30 06:25

    Here is a way that worked for me:

    HttpGet httpRequest = new HttpGet(url);
    HttpClient httpclient = new DefaultHttpClient();
    HttpResponse response = (HttpResponse) httpclient
                        .execute(httpRequest);
    HttpEntity entity = response.getEntity();
    BufferedHttpEntity bufferedHttpEntity = new BufferedHttpEntity(entity);
    InputStream is = bufferedHttpEntity.getContent();
    Drawable d = Drawable.createFromStream(is, "");
    //or bitmap
    //Bitmap b = BitmapFactory.decodeStream(is);
    

提交回复
热议问题