Skip to content

1.4.5 Regression in AsynHttpResponseHandler (bug ?) #633

Closed
@neoteknic

Description

@neoteknic

Hello,
I don't understand something about the new 1.4.5 version, the previous one 1.4.4 was wordking fine !
With the new API I just changed the onSucces (previously onSuccess(String response), now with 3 parameters

I Have a class:

public class Webservice extends Thread
{
   private AsyncHttpClient  httpClient;
   public Webservice(Activity a)
    {
      httpClient = new AsyncHttpClient();
      ...
    }

    @Override
     public void run()
     {
        ....
        httpClient.post(activity.getString(R.string.url_api),params,new AsyncHttpResponseHandler( ){

          @Override
          public void onSuccess(int statusCode, Header[] headers, byte[] response)
          {
          }
        });
     }
}

Now I have error : current thead has not called Looper.prepare() Forcing synchronous mode;
Tried to add Looper.prepare in the construcor but crash the app.
and another error Synchronous ResponsHangdler in AsyncHttpClient.
Maybe the fix is just to remove the check for Looper.prepare==null ?
I dont really undestand this but.
I think it's related to this change : Fixed Threading issue when used in Service or non-UI Thread context
Because I use it in a thread. But can you add an optino to force async mode, or should I use sync mode ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions