You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using SyncHttpClient to make synchronous requests from an IntentService. Here is the sample code-
SyncHttpClient syncClient = new SyncHttpClient();
// other initialization like JsonHttpResponseHandler
syncClient.get(url, parameters, responseHandler);
After making the request, I expect the onSuccess or onFailure to be called. Instead, I get the following exception-
java.lang.RuntimeException: Handler (com.loopj.android.http.AsyncHttpResponseHandler$ResponderHandler) {53554578} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:294)
at android.os.Handler.sendMessageAtTime(Handler.java:473)
at android.os.Handler.sendMessageDelayed(Handler.java:446)
at android.os.Handler.post(Handler.java:263)
at com.loopj.android.http.AsyncHttpResponseHandler.postRunnable(AsyncHttpResponseHandler.java:412)
at com.loopj.android.http.JsonHttpResponseHandler$1.run(JsonHttpResponseHandler.java:153)
at java.lang.Thread.run(Thread.java:856)
What's the correct way to make synchronous requests?
The text was updated successfully, but these errors were encountered:
Hi,
I am using SyncHttpClient to make synchronous requests from an IntentService. Here is the sample code-
After making the request, I expect the onSuccess or onFailure to be called. Instead, I get the following exception-
What's the correct way to make synchronous requests?
The text was updated successfully, but these errors were encountered: