Hi I want to parse this json:
[{
\"codError\": 0,
\"msg\": \"OK\"
}, {
\"id\": 1,
\"role\": {
\"id\": 4,
\"name\": \"Super\",
First of all, the U4 doesn't seems JSON correct. I would have write it like:
{
"your array":["U4"]
}
then use the method to get your array
JSONArray array = jsonObj.getJSONArray("your array");
then you can access the values on your JSONArray by iterating over it, like that
for (int i = 0; i < array.length(); i++) {
array.getJSONObject(i);
}
Hope I help