gpt4 book ai didi

java - 使用 userID 获取大头像 Facebook

转载 作者:太空狗 更新时间:2023-10-29 16:35:07 26 4
gpt4 key购买 nike

当我使用图片 ID 时,我有点不确定如何从 facebook current 检索大头像。我正在将此 URL 加载到我的 ImageView 中。

http://graph.facebook.com/1454465268197338/picture?type=large

但它不会加载,当我输入它时虽然它有效。

https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xft1/v/t1.0-1/p200x200/11014854_1403982213245644_5725357301610737602_n.jpg?oh=9d95140ca58c8e13a950e14f63018ff4&oe=55F8A88F&gda=1442905098_49d2c7ec583d417722e02a10206c0fb6

我上面放的是第一个放后的REDIRECTED URL。问题是我无法使用给定的用户 ID 生成它,因为我正在使用它。

@Override
public void onBindViewHolder(ContactViewHolder contactViewHolder, int i) {
Event ci = contactList.get(i);
contactViewHolder.vName.setText(ci.name);

TinyDB userinfo =new TinyDB(context);

String user_id = userinfo.getString("id");
profile_pic_url ="http://graph.facebook.com/"+user_id+"/picture?type=large";

Picasso.with(context)
.load(profile_pic_url)
.resize(225, 225)
.centerCrop()
.into(contactViewHolder.vProfilePic);

}

注意profile_pic_url。

那么最终,我如何才能获得重定向的 url(因为我知道它有效)?

我怎样才能从用户那里得到一个大的 facebook 个人资料图片 url,因为请记住 facebook android id,因为我从中得到的是:

                parameters.putString("fields", "id,name,link,picture,friends");

真的很小。

我试过用

Java - How to find the redirected url of a url?

https://developers.facebook.com/docs/graph-api/reference/user/picture/

不幸的是,没有运气,

感谢帮助。

蒂蒂

最佳答案

尝试

parameters.putString("fields", "id,name,link,picture.type(large),friends");

– 这应该会为您提供大版本的个人资料图片。

(这使用 Field Expansion 语法来更准确地指定您想要的数据。)

关于java - 使用 userID 获取大头像 Facebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30678367/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com