每次我在我的页面上启动提示时,我都会得到以下信息:'[1] 5.onErrorResponse: Error:' 没有错误消息。但它在 yahoo 管道 json 页面上运行良好,我不明白为什么,我认为我的 json 有问题,但我可以发现任何东西?
mRequestQueue = Volley.newRequestQueue(acc);
final String URL = "x";
// pass second argument as "null" for GET requests
JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET,URL,null,new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
VolleyLog.v("Response:%n %s", response.toString(4));
// parseJSON(response);
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.e("Error: ", error.getMessage());
}
});
mRequestQueue.add(req);