2015-09-01 66 views

回答

1

下面是重寫正確的方法,

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); 
} 
0

使用這個 對於頭

import cz.msebera.android.httpclient.Header;

0

你需要重寫正確的方法。一些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來避免錯誤。

相關問題