我有一个缓冲字符串,我想通过将其设置为ImageView
将其显示为Android中的图像。如何将缓冲区字符串转换为图像?
你能告诉我怎么样?
我的逻辑是:
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);
Thnx bro ... thnx很多.. :) – nilesh