hi have implemented facebook login app , trying download users profile picture , pass roundedimageview encountering error when test , there no image showing, error is:
skia﹕ --- skimagedecoder::factory returned null i getting these 2 errors directly before it
readstreamtobuffer : qmage stream read error!! required length 12 bytes, red 0 bytes isqmage : input skstreamrewindable length less qmage minimum size : 0 here main asynctask downloading , setting image
private class downloadimagetask extends asynctask<string, void, bitmap> { private imageview bmimage; public downloadimagetask(imageview bmimage) { this.bmimage = bmimage; } protected void onpreexecute() { } protected bitmap doinbackground(string... urls) { string userid = urls[0]; bitmap bmp = null; try { url image_value = new url("http://graph.facebook.com/"+ userid + "/picture?type=large"); bmp = bitmapfactory.decodestream(image_value.openconnection().getinputstream()); } catch (ioexception e) { log.e("error", "image download error"); log.e("error", e.getmessage()); e.printstacktrace(); } return bmp; } protected void onpostexecute(bitmap result) { bmimage.setimagebitmap(result); } } and here how call it
final roundedimageview profilepic = (roundedimageview) rootview.findviewbyid(r.id.myprofilepic); new downloadimagetask(profilepic).execute(userid); thanks , help
Comments
Post a Comment