脸谱,机器人java.lang.IllegalStateException:无法执行的任务:任务已经运行 [英] facebook, android java.lang.IllegalStateException: Cannot execute task: the task is already running

查看:372
本文介绍了脸谱,机器人java.lang.IllegalStateException:无法执行的任务:任务已经运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

登录后,我可以,我可以做FB查询。几分钟(扮演游戏)的Facebook请求后失败的异常:

After login I can I can make FB queries. After few minutes (played game) Facebook requests fail exception:

java.lang.IllegalStateException: Cannot execute task: the task is already running

当我把它称为失败

        Request.executeMeRequestAsync(Session.getActiveSession(),
                new Request.GraphUserCallback() {...

        Request.executeGraphPathRequestAsync(Session.getActiveSession(),
                "me/apprequests", new Request.Callback() {...

        Request request = new Request(session, "me/apprequests", null,
                    null, new Request.Callback() { .... } );
        RequestAsyncTask status = request.executeAsync();

同样的呼叫将被立即登录后,他们的工作叫。 我有一个测试应用程序,它的工作原理。但在登陆后几分钟后真正的应用程序这是行不通的。

Same calls are called immediately after login and they work. I have a test app where it works. But in real app after few minutes after login it does not work.

推荐答案

您运行的UI线程?与 runOnUiThread

Are you running on UI thread? Wrap your code withrunOnUiThread

像<一个href="http://stackoverflow.com/questions/11791157/can-i-have-an-example-of-displaying-a-toast-using-runonuithread">this

Facebook的SDK 提到的异步调​​用必须从UI线程来完成

Facebook SDK mentions that async calls must be done from UI thread

这篇关于脸谱,机器人java.lang.IllegalStateException:无法执行的任务:任务已经运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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