How to get facebook profile picture of user in facebook SDK 3.0 Android

前端 未结 8 1108
太阳男子
太阳男子 2020-12-24 15:22

i am using facebook SDK 3.0 i have to get profile picture of user login. Here is the code I use:

URL image_value = new URL(\"http://graph.facebook.com/\"+id         


        
8条回答
  •  伪装坚强ぢ
    2020-12-24 15:33

    You can do something like this inside a thread:

    String url = "http://graph.facebook.com/"+id+"/picture";
    HttpConnection conn = new HttpConnection(url);
    conn.openConnection();
    
    Drawable d = Drawable.createFromStream(new BufferedInputStream(conn.getInputStream()), "image");
    
    conn.close();
    

    I hope it help you.

提交回复
热议问题