onFailure(...) was not overridden, but callback was received
logcat has warning W/JsonHttpRH﹕ onFailure(int, Header[], String, Throwable) was not overriden, but callback was received in my code. I haved try to solved and read this issued https://github.com/loopj/android-async-http/issues/944 but i can't solve it.
My code
AsyncHttpClient client = new AsyncHttpClient();
client.get(address, null, new JsonHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
//Code
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONArray errorResponse) {
Log.d(TAG , "onFailure : "+statusCode);
}
});
You have not overriden all methods of JsonHttpResponseHandler(). Check the documentation: https://github.com/loopj/android-async-http/blob/master/library/src/main/java/com/loopj/android/http/JsonHttpResponseHandler.java
There are several onFailure methods each with different parameter sets. According to your log you need to override the one with the following parameters: (int, Header[], String, Throwable).
@Override
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
Log.d(TAG , "onFailure : "+statusCode);
}
How to solve it, explain
@Mr-LYF override the methods you want to override, thats correct solution