安卓工作室:错误: 非法字符: “\u2028”
2022-09-01 13:35:39
我正在尝试执行 JSONObject 请求:
final String URL = "https://some/url";
// Post params to be sent to the server
HashMap<String, String> params = new HashMap<String, String>();
params.put("param1", param1);
params.put("param2", param2);
params.put("param3", param3);
params.put("param4", param4);
JsonObjectRequest req = new JsonObjectRequest(URL, new JSONObject(params), new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
VolleyLog.v("Response:%n %s", "läuft");
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.e("Error: ", error.getMessage());
}
});
// add the request object to the queue to be executed
NetworkController.getInstance().addToRequestQueue(req);
我无法编译项目,因为我收到参数的语法错误:
错误:(144,9) 错误: 非法字符: “\u2028”
我该如何解决这个问题?