开发者

create imageview from base64.decode

I have this problem: I want represent a base64 string to image that come from php page in my android application (the string base64 work fine and come good) so I have done this:

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);

I don't see the imageview


A quick Google search finds one of your other duplicate questions as the first result, and this as the second. See the accepted answer from that question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜