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

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -