httpentity が InputStream に画像のバイナリ データを持ち、さらに処理するためにライブラリ ファイル [ String str = EntityUtils.toString(httpResponse.getEntity())
] で文字列として変換されているシナリオを用意し、その文字列から入力ストリームを取得しようとしています。
問題を理解するために、以下のシナリオを取り上げます。
動作中 - ImageView がコンテンツとともに表示されます
InputStream inStream = getContentResolver().openInputStream(thisPhotoUri);
Bitmap bm = BitmapFactory.decodeStream(inStream);
ImageView view = (ImageView)findViewById(R.id.picture_frame);
view.setImageBitmap(bm);
問題 - ImageView が画像とともに表示されない
InputStream inStream = getContentResolver().openInputStream(thisPhotoUri);
String str = inStream.toString();
InputStream is = new ByteArrayInputStream(str.getBytes());
Bitmap bm = BitmapFactory.decodeStream(is);
ImageView view = (ImageView)findViewById(R.id.picture_frame);
view.setImageBitmap(bm);