Android and Facebook: How to get picture of logged in User

前端 未结 7 1088
攒了一身酷
攒了一身酷 2020-12-08 06:30

I use the official Facebook SDK in my Android Application. After the user logs in, I can get the uid and the name of the facebook user like so:

Facebook mFac         


        
7条回答
  •  难免孤独
    2020-12-08 06:56

    ImageView user_picture;
     userpicture=(ImageView)findViewById(R.id.userpicture);
     URL img_value = null;
     img_value = new URL("http://graph.facebook.com/"+id+"/picture?type=large");
     Bitmap mIcon1 = BitmapFactory.decodeStream(img_value.openConnection().getInputStream());
     userpicture.setImageBitmap(mIcon1);
    

    where ID is ur profile ID...

提交回复
热议问题