我想显示用户好友的图片和姓名,但是getPicture()
方法似乎不起作用。
谁能告诉我用什么方法来获取用户好友的照片?
我的代码是
Connection<User> myFriends = facebookClient.fetchConnection("me/friends", User.class, Parameter.with("fields", "id,name,picture"));
// Fetching user connections
List<User> friendsList = myFriends.getData();
for (User userz : friendsList) {
// System.out.println(userz.getPicture() + " : " + userz.getName());
response.getWriter().println(userz.getId() + " : " + userz.getName()+" : " + userz.getPicture());
NetBeans 找不到 getPicture()
方法。
最佳答案
不需要任何方法就用这个
URL url= new URL("https://graph.facebook.com/<your friends id here>/picture?type=normal");
url.openStream
关于java - 使用RestFB获取用户好友图片的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11345797/