--- decoder->decode returned false
こんな感じにね
そんな時は、BufferedHttpEntityを使いましょう
実際のコードを以下に。(画像のURLは適当です)
HttpUriRequest httpRequest = new HttpGet("http://hogehoge.com/sample.jpg");
HttpClient httpclient = new DefaultHttpClient();
HttpResponse httpResponse = httpclient.execute(httpRequest);
HttpEntity httpEntity = httpResponse.getEntity();
BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(httpEntity);Bitmap image = BitmapFactory.decodeStream(bufHttpEntity.getContent());
0 件のコメント:
コメントを投稿