title: How to parse JSON Array inside another JSON Array in Android
body: <p>Please, please help me..
  I am working on a project and I am getting data from web-services in JSON format. I am trying to parse it but, I am unable to do it. I have this json-data-</p>
  
  <pre><code> {
          "response": {
              "status": {
                  "code": "1",
                  "message": "sucess",
                  "user_id": "1"
              },
              "foods": [
                  {
                      "char": "A",
                      "content": [
                          {
                              "food_name": "add Malt"
                          },
                          {
                              "food_name": "a la mode"
                          },
                          {
                              "food_name": "Almonds"
                          }
                   ]
              },
              {
                  "char": "Z",
                  "content": [
                      {
                          "food_name": "Zebra Cakes"
                      },
                          {
                              "food_name": "Zucchini, Baby"
                          },
                          {
                              "food_name": "zxc"
                          }
                      ]
                  }
              ]
          }
      }
  </code></pre>
  
  <p>From here I am successfully able to get "foods" Array but I am getting stuck when I am trying to get "content" array and food_name data.</p>
  
  <p>I am using this code but I did not get any solution, please check this snip code.</p>
  
  <pre><code>protected String doInBackground(String... args) {
                  // Building Parameters
                  List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
                  nameValuePairs.add(new BasicNameValuePair("method","eat_tracking_details"));
                  nameValuePairs.add(new BasicNameValuePair("uid",userid));
                  // getting JSON string from URL
                  JSONObject json = jsonParser.makeHttpRequest(JSONParser.urlname,"GET", nameValuePairs);
                  //System.out.println("****json*"+json);
                  if (json != null) {
                      try {
                          JSONObject response = json.getJSONObject("response");
                          JSONObject status = response.getJSONObject("status");
                          code = status.getString("code");
                          JSONArray FoodArray = response.getJSONArray("foods");
                          for (int i = 0; i &lt; FoodArray.length(); i++) {
                              String character = FoodArray.getJSONObject(i).getString("char");
                              System.out.println("*****character****************"+character);
                              JSONArray FoodNameArray = new JSONArray(FoodArray.getJSONObject(i).getString("content"));
                              System.out.println("====================///////////"+FoodNameArray);
  
                              for (int j = 0; j &lt;FoodNameArray.length(); j++) {
                                  String Foodname = FoodArray.getJSONObject(j).getString("food_name");
                                  System.out.println("@@@@@@@@@@@@@"+Foodname);
                              }
                          }
  
                      } catch (JSONException e) {
                          // TODO: handle exception
                      }
                  }
  </code></pre>
  
  <p>Check this url for web-service response-
  <a href="http://24x7serverhost.com/carenet/webservices/ws.php?method=eat_tracking_details&amp;uid=1625">WEB-SERVICE URL</a></p>