android - How to download image from facebook Graph API -


i want download image facebook bitmap null.

[ private void extractfacebookicon(string id)   {     bitmap bitmap = null;       inputstream in = null;      try      {        strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build();        strictmode.setthreadpolicy( policy );        url imageurl = new url("http://graph.facebook.com/"+id+"/picture?type=large");         in = ( inputstream) imageurl.getcontent();         bitmap = bitmapfactory.decodestream( in );        mfacebookicon = bitmap;      }      catch(throwable e)      {       }] 

when use http://graph.facebook.com/"+id+"/picture?type=large in browser, chrome redirects me on link , picture opening , bitmap can read it.

("https://fbcdn-profile-a.akamaihd.net/hprofile-ak-frc3/t1.0-1/c0.0.1.00.1.00/p100x100/969878_592016040843290_1511913922_t.jpg)

how solve problem , read first link bitmap not null?

i think it's because facebook send application redirect url. have @ http://www.mkyong.com/java/java-httpurlconnection-follow-redirect-example/ see how can handle redirects (httpredirectexample code).


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -