StringRequest stringRequest = new StringRequest(
Request.Method.POST,
Configs.Login,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
progressDialog.dismiss();
try {
JSONObject obj = new JSONObject(response);
if(!obj.getBoolean("error")){
startActivity(new Intent(getApplicationContext(), MainActivity.class));
finish();
}else{
Toast.makeText(
getApplicationContext(),
obj.getString("message"),
Toast.LENGTH_LONG
).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
progressDialog.dismiss();
Toast.makeText(
getApplicationContext(),
error.getMessage(),
Toast.LENGTH_LONG
).show();
}
}
)
@Override
ERROR:タイプのORG:タイプのorg.json.JSONArrayはJSONObject
org.json.JSONExceptionを示すJSON形式で
- 私得るエラーに変換できません.json.JSONArrayは、これは私のJSON形式でJSONObject
に変換することはできません
[{ "ID": "1"、 "ノーム": "管理者"、 "電子メール": "[email protected] "、" password ":" xxxxxxx "}]
@ρяσѕpєєя送信したことはありません –