我有这个问题:我想代表一个base64字符串来表示来自我的android应用程序中php页面的图像(字符串base64可以正常工作,而且效果很好),所以我这样做了:

byte[] gzipBuff = Base64.decode(json_data.getString("immagine"),0);
ByteArrayInputStream memstream = new ByteArrayInputStream(gzipBuff, 0, gzipBuff.length);
ByteArrayOutputStream baos = new ByteArrayOutputStream(gzipBuff.length);
baos.write(gzipBuff);

Bitmap bmp = BitmapFactory.decodeStream(memstream);
ImageView image = new ImageView(this);
image.setImageBitmap(bmp);


我看不到imageview

最佳答案

快速的Google搜索将查找其他重复问题中的一个作为第一个结果,而将this作为第二个结果。请参阅该问题的accepted答案。

10-06 03:29