Grabbing String from Embedded MongoID in JSON Java Android -


i working on grabbing information json. server responds with:

{     "id" : {         "$id" : "515a4f1d03cfebb61800097b"     },     "body" : "this body" } 

i can grab body

string body = json.getstring("body"); 

but not know how string contained in 'id'.

thanks in advance help!

do not know how string contained in 'id'.

because current jsonobject contains 1 jsonobject , 1 body key. $id inner jsonobject can as:

jsonobject jsonobj_id=json.getjsonobject("id");  // $id id jsonobject  string str_id=jsonobj_id.optstring("$id"); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -