Get user image from Facebook Graph-API

前端 未结 7 621
长发绾君心
长发绾君心 2020-12-01 03:22

I want to show the users profile picture in a list view. When I try to call the graph-api from android to retrieve the image, I always get the following error.

<         


        
7条回答
  •  遥遥无期
    2020-12-01 03:37

    You can it do it by Using ProfilePictureView instead of an image view:

    
    

    You can set the size to small/normal/large/custom.

    Then in your code, set the user facebook id like this:

    ProfilePictureView profilePictureView;
    profilePictureView = (ProfilePictureView) findViewById(R.id.friendProfilePicture);
    profilePictureView.setProfileId(userId);
    

    Hope this help.

提交回复
热议问题