I'm trying to get a value of my json. First here is my json.
{
"status": "true",
"userData": {
"user_id": "USER001",
"username": "boby",
"password": "c83e4046a7c5d3c4bf4c292e1e6ec681",
"fullname": "Boby Kurniawan",
"phone": "089688xxxxxxx",
"profilpic": null,
"status": null,
"flag": 1,
"tipe": "TP001",
"Deskripsi": "Ini tentang gua",
"Email": "boby@mail.com"
}
}
Ok, for the first there will be 2 json, if the login success the json will look like above, but when it fails it will return
{ "status" : "false" }
So I need to parse it right? so I add this line
JSONObject jsonObj = new JSONObject(result);
JSONArray status = jsonObj.getJSONArray("status");
but I get this error
unhandled exception : org.json.JSONException
how can I fix it?