I am trying to parse a JSON object in my android application and I do so like this
JSONObject json = new JSONObject(jsonString);
the value of jsonString is:
[{"pk": 1, "model": "mydb.user", "fields": {"username": "willyb", "password": "tao1",
"signup_date": "2011-11-28 09:15:58", "email": "wfbarksdale@gmail.com"}}]
Is there an obvious reason why this is failing?
Because this is a JSONArray, not JSONObject. (See here)
You should do: