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