arrays - how to get Category values from json in android? -
this question has answer here:
- how parse json in java 27 answers
{ "response": { "category": [ "restaurant", "salon", "spa", "dry cleaners", "car spa", "hospitals" ] } }
you can this-
try { string json = <your json string>; jsonobject response = new jsonobject(json); jsonarray category = response.getjsonarray("category"); (int = 0; < category.length(); i++) { log.d("categories are", category.getstring(i)); } } catch (jsonexception e) { e.printstacktrace(); }
Comments
Post a Comment