There are codes I am using:
try {
resultObject = new JSONObject(URLDecoder.decode(result, "UTF-8"));// no problem here
resultJsonArray = resultObject.getJSONArray("data"); // error comes when run this line.
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
This is the whole error information:
org.json.JSONException: Value [{"first_name":"aig","phone_no":"3659428","passcode":"aig","last_name":"aig","user_id":"03343785-2714-43a5-a566-f4d9877ccafa","email_id":"aig.science@gmail.com"},{"first_name":"aig","phone_no":"635448448","passcode":"aig","last_name":"aig","user_id":"5dc26dcc-3f81-434a-b293-48438f2f920a","email_id":"aig.science@gmail.com"}] at data of type java.lang.String cannot be converted to JSONArray
After being formatted(http://jsonformatter.curiousconcept.com/), the JSON string will be like this:
{
"response":"Success",
"tablename":"USER_INFO",
"transaction_type":"MODIFICATION_PULL_RESPONSE",
"data":"[{\"first_name\":\"aig\",\"phone_no\":\"3659428\",\"passcode\":\"aig\",\"last_name\":\"aig\",\"user_id\":\"03343785-2714-43a5-a566-f4d9877ccafa\",\"email_id\":\"aig.science@gmail.com\"},{\"first_name\":\"aig\",\"phone_no\":\"635448448\",\"passcode\":\"aig\",\"last_name\":\"aig\",\"user_id\":\"5dc26dcc-3f81-434a-b293-48438f2f920a\",\"email_id\":\"aig.science@gmail.com\"}]"
}