我使用android-async-http库从Loopj,onFailure没有在我的代码中调用,我已经尝试了所有三种方法..onFailure没有被调用 - onFailure(...)没有被覆盖,但回调被接受
W/JsonHttpRH:onFailure处(INT,部首[],字符串,Throwable的)没有重写,但回调接收
我使用android-async-http库从Loopj,onFailure没有在我的代码中调用,我已经尝试了所有三种方法..onFailure没有被调用 - onFailure(...)没有被覆盖,但回调被接受
W/JsonHttpRH:onFailure处(INT,部首[],字符串,Throwable的)没有重写,但回调接收
下面是重写正确的方法,
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
super.onFailure(statusCode, headers, responseString, throwable);
Log.d("Failed: ", ""+statusCode);
Log.d("Error : ", "" + throwable);
}
使用这个 对于头
import cz.msebera.android.httpclient.Header;
你需要重写正确的方法。一些onFailure是: 1.public void onFailure(int statusCode,Header [] headers,Throwable throwable,JSONObject errorResponse) 2.public void onFailure(int statusCode,Header [] headers,Throwable throwable,JSONArray errorResponse) 3 public void onFailure(int statusCode,Header [] headers,String responseString,Throwable throwable)
选择正确的onFailure来避免错误。