Skip to content Skip to sidebar Skip to footer

Facebook, Android Java.lang.illegalstateexception: Cannot Execute Task: The Task Is Already Running

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

Solution 1:

Are you running on UI thread? Wrap your code withrunOnUiThread

like this

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

Solution 2:

You can use Request.toHttpConnection(request) instead of request.executeAsync()

Post a Comment for "Facebook, Android Java.lang.illegalstateexception: Cannot Execute Task: The Task Is Already Running"