在這裏,我沒有得到任何迴應是否有任何錯誤在這段代碼中我已經使用API中的兩個參數,我已經存儲在參數中,雖然在錯誤進入**新的JSONObject(PARAMS)** API是可以正常使用,但
onErrorResponse:錯誤:Android - 使用Volley顯示自定義列表視圖錯誤
HashMap<String, String> params = new HashMap<String, String>();
params.put("employeeId", "dd25ec65-e276-488b-92b1-a324a1d4cc18");
private void getData(){
//Showing a progress dialog
final ProgressDialog loading = ProgressDialog.show(this,"Loading Data", "Please wait...",false,false);
//Creating a json obj request
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Config.DATA_URL,new JSONObject(params),
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
VolleyLog.v("Response:%n %s",response.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.e("Error: ", error.getMessage());
}
});
//Creating request queue
RequestQueue requestQueue = Volley.newRequestQueue(this);
//Adding request to the queue
requestQueue.add(jsonObjectRequest);
}
你得到的錯誤是什麼? – earthw0rmjim
只有日誌中的錯誤。 – Abhi
[] url:0x8ede18 NORMAL null – Abhi