android - Please somebody tell me how to create a bitmap out of this? -
im building app, makes possible , download image files. im receiving inputstream server when ask image files. if call method after uploaded picture without closing app first, possible decode stream bitmap , works fine.
but if close first, doesn't work , content looks different. string looks "{"attachment":"/9j/4s5rxhp....."
bufferedreader streamreader = new bufferedreader(new inputstreamreader(inputstream, "utf-8")); stringbuilder responsestrbuilder = new stringbuilder(); string inputstr; while ((inputstr = streamreader.readline()) != null) responsestrbuilder.append(inputstr); jsonobject att = new jsonobject(responsestrbuilder.tostring()); byte[] bytes = base64.decode(att.getstring("attachment"), base64.default); bmp = bitmapfactory.decodebytearray(bytes, 0, bytes.length);
Comments
Post a Comment