Hi I want to parse this json:
[{
\"codError\": 0,
\"msg\": \"OK\"
}, {
\"id\": 1,
\"role\": {
\"id\": 4,
\"name\": \"Super\",
{
represents the Jsonobject and [
represents the jsonarray
Parse like this to get the role_id
loginName
from your json
JSONArray jsonarr =new JSONArray(yourstring);
JSONObject jobj=jsonarr.getJSONObject(1);
JSONObject role =jobj.getJSONObject("role");
String role_id = role.getInt("id");
String loginName=jsonarr.getString("loginName");