-1

{ "response": { "Category": [ "Restaurant", "Salon", "Spa", "Dry Cleaners", "Car Spa", "Hospitals" ] } }

2 Answers2

0

Try this , it can be Pseudo Code

 String json = <YourJSon String>
    JSONObject object = new JSONObject(json);
    JSONArray array = object.getJSONArray("Category");

    for(int i =0; i<array.size();i++){
    String s = array.get(i).getString();
    }
Sanjeet A
  • 5,171
  • 3
  • 23
  • 40
eddykordo
  • 607
  • 5
  • 14
0

You can do like this-

     try {
            String json = <Your Json String>;
            JSONObject response = new JSONObject(json);
            JSONArray category = response.getJSONArray("Category");
            for (int i = 0; i < category.length(); i++) {
                Log.d("categories are", category.getString(i));
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
Sanjeet A
  • 5,171
  • 3
  • 23
  • 40