java - How to parse json array in android with no name? -
how can parse json array in android looking like:
["bhubaneswar","bangalore cant","brahmapur","visakhapatnam", "vijayawada road","asokhar","chaurakheri","banihal","sadura","anantnag", "panjgam","awantipura","kakapora","pampore"]
what trying is:
try { jsonobject json = new jsonobject(s); jsonarray jsonarray = json.names(); ( int = 0 ; < jsonarray.length();i++) { toast.maketext(getapplicationcontext(),jsonarray.getint(i),toast.length_long).show(); } } catch (jsonexception e) { e.printstacktrace(); }
but not getting output.
try this...
try { jsonarray jsonarray = new jsonarray(s); ( int = 0 ; < jsonarray.length();i++) { toast.maketext(getapplicationcontext(),jsonarray.getstring(i),toast.length_long).show(); } } catch (jsonexception e) { e.printstacktrace(); }
Comments
Post a Comment