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
Post a Comment