服务器json是utf-8格式的
Android下用volly请求总是报错
Value  of type java.lang.String cannot be converted to
解决方法:
复写volly的
JsonObjectRequest
public class JsonObjectUTF8Request extends JsonObjectRequest { public JsonObjectUTF8Request(String url, JSONObject jsonRequest, Response.Listener<JSONObject> listener, Response.ErrorListener errorListener) { super(url, jsonRequest, listener, errorListener); } @Override protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) { try { String jsonString = new String(response.data, "utf-8"); MyUtils.ShowLog("请求打印"+jsonString); return Response.success(new JSONObject(jsonString), HttpHeaderParser.parseCacheHeaders(response)); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } catch (JSONException je) { return Response.error(new ParseError(je)); } } }