如何在android中获取用户的个人资料图片

use*_*ser -4 android facebook

我想获取在Android应用程序中登录并在Imageview中设置的用户的个人资料图片和用户名

我没有得到如何获取个人资料图片.

谢谢提前

Dam*_* R. 16

只需使用facebook ProfilePictureView而不是图像视图:

<com.facebook.widget.ProfilePictureView
   android:id="@+id/friendProfilePicture"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:gravity="center_horizontal"
   android:padding="5sp"
   facebook:preset_size="small" />
Run Code Online (Sandbox Code Playgroud)

您可以将大小设置为小/正常/大/自定义.

然后在你的代码中,设置用户的facebook id如下:

ProfilePictureView profilePictureView;
profilePictureView = (ProfilePictureView) findViewById(R.id.friendProfilePicture);
profilePictureView.setProfileId(userId);
Run Code Online (Sandbox Code Playgroud)

希望这有帮助.