Volley JsonObjectRequest请求不起作用
RequestQueue queue = MyVolley.getRequestQueue(); JsonObjectRequest jsObjRequest = new JsonObjectRequest(Request.Method.POST,SPHERE_URL,null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { System.out.println(response); hideProgressDialog(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { hideProgressDialog(); } }) { protected Map<String, String> getParams() throws AuthFailureError { Map<String, String> params = new HashMap<String, String>(); params.put("id","1"); params.put("name", "myname"); return params; }; }; queue.add(jsObjRequest);
相关分类