Facebook新sdk - 无法获得朋友列表 [英] Facebook new sdk - not able to get friends list

查看:92
本文介绍了Facebook新sdk - 无法获得朋友列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用新的 Facebook-sdk 并使用hackbook示例使用 FriendsList.java 文件。 Friendlist Activity 每次都被杀死,我在logcat中收到此错误:

I am using the new Facebook-sdk and using the hackbook example to get the list of friends using FriendsList.java file. The Friendlist Activity gets killed everytime and I am getting this error in the logcat:

11-18 16:20:51.141: ERROR/JavaBinder(7881): !!! FAILED BINDER TRANSACTION !!!.

该问题每次都可重现。注意个人资料中的朋友数量是4500.

The issue is reproducible everytime. Note number of friends in the profile are 4500.

11-18 16:19:27.932: DEBUG/Facebook-Util(7881): GET URL: https://api.facebook.com/restserver.php?access_token=**********&query=select+name%2C+current_location%2C+uid%2C+pic_square+from+user+where+uid+in+%28select+uid2+from+friend+where+uid1%3Dme%28%29%29+order+by+name&method=fql.query&format=json

11-18 16:20:50.982: WARN/InputManagerService(3426): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4665a200
11-18 16:20:51.141: ERROR/JavaBinder(7881): !!! FAILED BINDER TRANSACTION !!!

请帮忙!

推荐答案

我没发布任何代码,因为我使用的是Facebook sdk的示例代码,可在 Facebook - Android的Hackbook示例。
最后我发现了这个问题并解决了这个问题。

I didnt post any code because I was using the example code of Facebook sdk available at Facebook - Hackbook example for Android. Finally I found the issue and solved it.

首先问题不在于Facebook sdk,而是响应的大小。如果您在Facebook中有超过4k的朋友,并使用 fql.query 图表方法查询朋友列表,则Json响应大小超过500kb。现在,如果您尝试通过IPC(意图额外数据)将此500kb响应传递给另一个活动,则进程失败,原因是
关于Failed binder事务的更多信息可以在
绑定器事务讨论失败

First the issue is not in facebook sdk but with the size of the response. If you have more than 4k friends in facebook and you query for the friends list using fql.query or graph methods then the Json response size is more than 500kb. Now if you try to pass this 500kb response via IPC (Intent extra data) to another activity the process failed with reason !! Failed binder transaction !! More info on Failed binder transaction can be found at Failed binder transaction discussion

我如何解决这个问题:
我使用与上面发布的链接中使用的相同的过程。即将响应写入文件,并将文件链接发送到其他活动,而不是完整的500kb大小响应。

How I solved this issue: I used the same procedure as used in the link I have posted above. I.e. writing the response to a file and sending the file link to the other activity instead of the full 500kb size response.

这篇关于Facebook新sdk - 无法获得朋友列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆