如何使用 Android 版 Facebook 同步的联系人图片
我的手机上安装了 Android 版 Facebook,它会自动将联系人列表中人员的 FB 个人资料图片同步到我的手机。
我想在我访问 ContactsContract.PhoneLookup
的应用程序中使用这些图片。
我真的需要 Facebook SDK 才能做到这一点吗?我想不是,但我找不到任何证据表明图片被保存在 ContactsContract
周围的某个地方
I'm having Facebook for Android on my phone which automatically synces the FB profile pictures of the people in my contact list to my phone.
I'd like to use those pictures within my app where I access ContactsContract.PhoneLookup
.
Do I really need the Facebook SDK to do that? I guess not, but I cannot find any evidence of the pictures being saved somewhere around ContactsContract
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您只需查询照片 URI 并根据您的需要使用该 URI。
此方法会对您有所帮助
或者还有另一种方法:
请注意,URI 记录可能不存在。例如,如果图像存储在 SDCard 上但不存在,则 URI 将不会返回有关它的照片。为此,您需要做进一步的检查。
这也会对您有所帮助(如果 Uri 失败,它会设置默认的占位符图像):
并调用该函数(contactimage 是 ImageView):
You simply need to query for the Photo URI and use the URI as per your needs.
This method will help you
Or there is another approach:
Please note that the URI record may not exists. If the images for example are stored on the SDCard and that is not present, the URI will return no photo about it. For this you need to do further checks.
This will help you also (if Uri fails it sets a default placeholder image):
and calling that function (contactimage is an ImageView):
这将通过电话号码获取您的 Facebook 照片:
This will get you your facebook photos by phoneNumber: