first of all, I've read a ton of similar questions on this site and none has solved my problem so
I have this json file that I create using php :
{
"done":true,
"data":"[
{\"id\":\"5099\",\"user_id\":\"892\"},
{\"id\":\"5100\",\"user_id\":\"892\"}
....
]"}
now in java android I want to parse it but it gives me this error: JSON.TypeMismatch
this is my android code to parse the json file:
//class from which I get the json in a JSONObject - works fine so far
JSONObject httpResult = itemHttpRequest.get("/fetch?currentList=&sort=recent&extra=");
try {
JSONArray httpData = httpResult.getJSONArray("data");
} catch (JSONException e) {
e.printStackTrace();
}
but it keeps giving me error.
is it because the data array in my json file is surrounded by quotes?
please help