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

前端 未结 8 1077
太阳男子
太阳男子 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:50

    try this..

     try {
            imageURL = new URL("https://graph.facebook.com/" +
                                                    id+ "/picture?type=large");
            Log.e("URL", imageURL.toString());
            } catch (MalformedURLException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                 try {
                        bitmap = BitmapFactory.decodeStream(imageURL
                                    .openConnection().getInputStream());
                    } catch (IOException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                    }
    
          ProfileDp.setImageBitmap(bitmap);
    
    0 讨论(0)
  • 2020-12-24 15:52

    Use ProfilePictureView from facebook sdk.

    0 讨论(0)
提交回复
热议问题