I have a buffered string and I want to display it as an Image in Android by setting it to an ImageView.
Can you please tell me how?
My logic is:
HttpEntity resEntity = responsePOST.getEntity();
if (resEntity != null) {
buffer = new StringBuffer("");
buffer.append(EntityUtils.toString(resEntity));
}
byte []bt = buffer.toString().getBytes();
Bitmap i = BitmapFactory.decodeByteArray(bt, 0,bt.length);
img.setImageBitmap(i);
instead of this
use this
I dont know what your buffer is, but try getting bytes directly instead of converting it into String and then getting bytes.