java - Parse JSON with unknown key? -
i have json output :
the numbers 2922 , 3910 random numbers. how can store values in "name" in array?
thank you.
you can use iterator.
using iterator, can iterate elements of list in either direction. can access next element calling next() method .
jsonobject reader = new jsonobject(success); iterator iteratorobj = reader .keys(); arraylist<string> al_getallkeys=new arraylist<string>(); while (iteratorobj.hasnext()) { string getjsonobj = (string)iteratorobj.next(); ..... system.out.println("key: " + key + "------>" + getjsonobj); }
Comments
Post a Comment