ユーザー名やパスワードなどのパラメータを送信します。Android Json解析文字列をjsonオブジェクトエラーに変換できません
Stringをjsonobjectに変換できないようなエラーが発生しました。
私はこのhappening.Anyoneは、plsは私のコードである私を助けて何を知らない:
JSONObject obj=new JSONObject();
try{
obj.put("username","test");
obj.put("password","test");
} catch (JSONException e) {
}
JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.POST,
urlJsonObj, obj, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
} catch (JSONException e) {
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
// Adding request to request queue
AppController.getInstance().addToRequestQueue(jsonObjReq,json_obj_req);
}
どのラインでエラーが表示されますか? –