title: Android studio : How to loop through JSON objects within another JSON object
body: <p>So i have a Pizza object with three String parameters (name, ingredients, image).
  And i have a JSON string in the format :</p>
  
  <pre><code>{"Meat pizza":{"Ingredients":"cheese,meat","image":"meat"},"Cheese pizza":{"Ingredients":"cheese","image":"cheese"}}
  </code></pre>
  
  <p>Which i assume is JSON objects within a JSON object.
  I'm using Volley library and so far i came up with this:</p>
  
  <pre><code>private RequestQueue queue = Volley.newRequestQueue(this);
  private String url ="http://daviddurand.info/D228/pizza/";
  public ArrayList&lt;Pizza&gt; listPizza(){
      final ArrayList&lt;Pizza&gt; list=new ArrayList&lt;&gt;();
      StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      JSONObject obj = null;
                      try {
                          obj = new JSONObject(response);
                          Iterator&lt;String&gt; iter = obj.keys();
                          while (iter.hasNext()) {
                              String key = iter.next();
                              try {
                                  Pizza pizza=new Pizza();
                                  Object value = obj.get(key);
                                  //fill the Pizza object with data
                                  pizza.setName();
                                  pizza.setIngredients();
                                  pizza.setImage();
                                  //insert it into the list
                                  list.add(pizza);
                              } catch (JSONException e) {
                                  // Something went wrong!
                              }
                          }
                      } catch (JSONException e) {
                          e.printStackTrace();
                      }
                  }
              }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              //error
          }
      });
  // Add the request to the RequestQueue.
          queue.add(stringRequest);
          return list;
      }
  </code></pre>
  
  <p>Which as you may have guessed already does nothing so far since i have no idea how to get the data to fill the Pizza object..</p>
  
  <p>Note : it's worth to mention that i can't modify how the data is created seeing as how i'm forced into using it from <a href="http://daviddurand.info/D228/pizza/" rel="nofollow" title="here">here</a></p>