java - Json : Content Parsing error -


i have json file this

[      {         "topic": "example1",         "ref": {             "1": "example topic",              "2": "topic"         },         "contact": [             {                 "ref": [                     1                 ],                  "corresponding": true,                  "name": "xyz"             },              {                 "ref": [                     1                 ],                  "name": "zxy"             },              {                 "ref": [                     1                 ],                  "name": "abc"             },              {                 "ref": [                     1,                      2                 ],                  "name":"bca"             }         ] ,           "type": "presentation"      } ] 

i want parse ref array. tried this. showing error.

jsonarray.getjsonobject(index).getjsonarray("ref").getjsonobject(index).tostring() 

now question is

1) correct way parse array's content.

the whole json array (starts [). first element object (starts {). object has attribute "ref". value object (starts {).

so, object, need

jsonarray.getjsonobject(index).getjsonobject("ref") 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -