我使用android-async-http,並覆蓋所有onSuccess
和onFailure
方法,但我得到了錯誤: onSuccess(int, Header[], JSONObject) was not overriden, but callback was received
。的onSuccess(INT,標題[]的JSONObject)沒有重寫,但回調收到
cz.msebera.android.httpclient.client.HttpResponseException: Not Found
我只是想知道我真的重寫這個方法。 還有我的日誌:onSuccess JSONObject:{"error":null,"success":false}
public static void querySecurityCode(String username) {
RequestParams params = new RequestParams();
params.put("username", username);
VStarRestClient.getClient().setEnableRedirects(true);
VStarRestClient.post(GET_SECURITY_CODE_URL, params, new JsonHttpResponseHandler(){
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
super.onSuccess(statusCode, headers, response);
Log.i("ws", "---->>onSuccess JSONObject:" + response);
}
@Override
public void onSuccess(int statusCode, Header[] headers, JSONArray response) {
super.onSuccess(statusCode, headers, response);
Log.i("ws", "---->>onSuccess JSONArray");
}
@Override
public void onSuccess(int statusCode, Header[] headers, String responseString) {
super.onSuccess(statusCode, headers, responseString);
Log.i("ws", "---->>onSuccess responseString");
}
@Override
public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
super.onFailure(statusCode, headers, responseString, throwable);
Log.i("ws", "---->>onFailure:" + throwable.toString());
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
super.onFailure(statusCode, headers, throwable, errorResponse);
Log.i("ws", "---->>onFailure" + throwable.toString());
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONArray errorResponse) {
super.onFailure(statusCode, headers, throwable, errorResponse);
Log.i("ws", "---->>onFailure" + throwable.toString());
}
});
}