Android loopj Async Http crashes after 1.4.5 update

前端 未结 5 2011
谎友^
谎友^ 2021-02-04 05:35

The new update for Android loopj Async Http lib is out and they changed a lot. Now you need to manually set Looper.prepare() otherwise it uses synchronious mode ins

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-04 06:02

    I disagree with doing it Paul's way. Although I can't really see a good way to get around this as the way I'm about to present is fairly hacky as well, but instead of using AsyncHttpResponseHandler use this class instead

    public abstract class AlwaysAsyncHttpResponseHandler extends AsyncHttpResponseHandler {
        @Override
        public boolean getUseSynchronousMode() {
            return false;
        }
    }
    

提交回复
热议问题