Facebook Android SDK 当 Facebook 请求失败时调用 facebook.authorize

发布于 2024-12-16 13:47:19 字数 246 浏览 5 评论 0原文

每当我的应用程序向 facebook 发出的请求失败时,我都会尝试调用 facebook.authorize。

但它会抛出 Can't create handler inside thread that has not called Looper.prepare() inside 侦听器错误。

我正在 Facebook 错误处理程序上的 try-catch 中进行调用。

还有其他方法来处理这个问题吗?

I am trying to call facebook.authorize whenever a request made by my app to facebook fails.

But it throws a Can't create handler inside thread that has not called Looper.prepare() inside listener error.

I am making the call from a try-catch on Facebook error handler.

Is there another way of handling this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜宝宝 2024-12-23 13:47:19

这个问题在这里解决了

Facebook 授权在 Android Asynctask 或主题

            Looper.prepare();
            facebook.authorize(this, PERMISSIONS, new LoginDialogListener());
            Looper.loop();

This problem is solved over here

Facebook authorize not working inside Android Asynctask or Thread

            Looper.prepare();
            facebook.authorize(this, PERMISSIONS, new LoginDialogListener());
            Looper.loop();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文