https://issues.jboss.org/browse/RF-1236
但是我在下面的代码中得到错误AsyncHttpResponseHandler说AsyncHttpResponseHandler类必须声明为abstract或实现抽象方法android
client.get(“Following this tutorial”,params,new AsyncHttpResponseHandler ()
答案 0 :(得分:2)
从official doc开始,正确的实现是:
AsyncHttpClient client = new AsyncHttpClient();
client.get("http://www.google.com", null, new AsyncHttpResponseHandler() {
@Override
public void onStart() {
// called before request is started
}
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] response) {
// called when response HTTP status is "200 OK"
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {
// called when response HTTP status is "4XX" (eg. 401, 403, 404)
}
@Override
public void onRetry(int retryNo) {
// called when request is retried
}
});