java - Convert string to JSON and get value -


i have string:

{"markers":[{"tag":"1","dep":"2"}]} 

how convert json , value tag , dep?

you need jsonobject this

jsonobjectrequest jsobjrequest = new jsonobjectrequest(request.method.get,url, null, new response.listener<jsonobject>() {      @override     public void onresponse(jsonobject response) {         string tag, dep;          jsonarray jarray = response.getjsonarray("markers");         jsonobject msg = jarray.getjsonobject(0);         tag = msg.getstring("tag");         dep = msg.getstring("dep");     } } 

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -