mutiple json string in android -
i have return json string. example have 1 json string:
[{"locationvalue":"payroll - 9","locationid":"465","isselected":false}]
and returned second json string:
[{"cc2description":"denver - dn","cc2":"dn","isselected":false},{"cc2description":"las vegas - lv","cc2":"lv","isselected":false}]
ans on.
in android have written this:
jsonarray jsonobject = new jsonarray(jsonstring.tostring()); for(int i=0;i<jsonobject.length();i++) { log.v("log", jsonobject.getstring(i)); }
but can access 1 json array. want other json array also.
you cannot decode multiple separate json structures in single call. json structure must complete proper javascript object or array on own, e.g.
two arrays this:
[1,2,3][4,5,6]
is invalid, because it's 2 separate arrays smashed against each other. however,
[[1,2,3],[4,5,6]]
is ok, because it's single array contains 2 separate child arrays. can return multiple separate json strings, must contained within single structure.
Comments
Post a Comment