arrays - how to get Category values from json in android? -


this question has answer here:

{ "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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -