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
It fails when I call
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.
You can use Request.toHttpConnection(request) instead of request.executeAsync()
Are you running on UI thread? Wrap your code with
runOnUiThread
like this
Facebook SDK mentions that async calls must be done from UI thread