android - How to get the pass one Json object into another -


i doing json parsing , have stuck on here, in jsonobject , inside have jsonobject. getting label etc values how parse actionparam values inside.

{                 "label": " day schedule",                 "action": "schedule",                 "actionurl": "https:\/\/www.abc.com\/api\/2\/event\/schedule.php",                 "actionparams": {                     "id": "108501",                     "dr": "1390107600-1390194000",                     "track": "108625"                 } 

thank in advance

so actionparams value nested jsonobject - indicated { } bracket. need think of parsing json unpacking set of russian nesting dolls. need to

(1) create jsonobject intiial string contains actionvalues

jsonobject firstobject = new jsonobject(stringvalue); 

(2) actionparams jsonobject initial object

jsonobject actionparams = firstobject.getjsonobject("actionparams"); 

(3) extract individual string values actionparams object

string id = actionparams.getstring("id"); 

i don't know if whole string idea same. create 1 object , unwrap step step others.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -