title: how to parse a JSON data in side a table layout dynamically?In Android from a URL
body: <p>I am Parsing a a JSON data from a URL..
  I followed <a href="http://www.androidbegin.com/tutorial/android-parsing-yql-using-json-tutorial/" rel="nofollow noreferrer">this</a> tutorial to parse the dynamic JSON data</p>
  
  <p>now am parsing the data,.
  in a List view.. when I click on that list view a New Item view will appear in that I want to add some contents which are form a JSON data.. But its viewing the last one of the data So I parse it with a string format but I am getting the data in string but I want that data in a table..</p>
  
  <p>this is my JSON data<code>{
      "request": "ok",
      "query": {
          "result": [
              {
                  "details": [
                      {
                          "offers": [
                              {
                                  "id": "UUkY8",
                                  "model": "XL"
                              },
                              {
                                  "id": "UUkY8",
                                  "model": "XXL"
                              }
                          ],
                          "count": 2,
                          "url": "http://www.wallmart.com"
                      },
                      {
                          "offers": [
                              {
                                  "id": "NNkz4",
                                  "model": "XL"
                              },
                              {
                                  "id": "NNkz4",
                                  "model": "XXL"
                              }
                          ],
                          "count": 2,
                          "url": "http://www.amazon.com"
                      }
                  ],
                  "flag": [
                      "http://www.donkersct.nl/wordpress/wp-content/uploads/2012/07/stackoverflow.png"
                  ]
              }
          ]
      }
  }</code></p>
  
  <p>and I am parsing that in this way </p>
  
  <pre><code>JSONArray json_results_details =c.getJSONArray("details");
                        System.out.println("looping json_results_details");
                        String strOffermodel="";
                          for (int j = 0; j &lt; c.length(); j++) {
                              System.out.println("looping json_results_details[" + j +"]" + "json_results_details.length() --&gt;" + json_results_details.length());
  
                              if (j &lt; json_results_details.length()) {
  
                                  JSONObject d = json_results_details.getJSONObject(j);
                                  stridsName += d.optString("name")+",";
                                  stridsURLs += d.optString("url")+",";
  
                                  // Get site details
  
                                  long lOffer_Counts =-1;
                                  try {
                                      lOffer_Counts= Long.parseLong(d.optString("offers_count"));
  
                                  } catch(Exception e) {
                                      lOffer_Counts =-1;
                                  }                               
                                  strOffersCount+= String.valueOf(lOffer_Counts) + ",";
  
                                  if(lOffer_Counts &gt; 0) {
  
                                      JSONArray json_offers = d.getJSONArray("offers");
                                      System.out.println(json_offers.toString());
                                      String strmodel="";
                                      for (int k = 0; k &lt; json_offers.length(); k++) {
  
  
                                           JSONObject e = json_offers.getJSONObject(k);
  
                                            map.put("id", e.optString("id"));
                                            map.put("model", e.optString("model"));
                                            strmodel += e.optString("model") + "$";
                                        }  
                                      strOffermodel += strmodel + ",";
                                  }
                                  else
                                  {
                                      strOffermodel += ",";
                                  }
  
                                  map.put("id", stridsName);
                                  map.put("model", strOffermodel);
                                 }
                           }
                          arraylist.add(map);
  </code></pre>
  
  <p>So no I am getting the Model in loop.</p>
  
  <p>as <code>Model:XL,XXL/XL,XXL...</code></p>
  
  <p>I tried with list view but failed now I am trying with table View..
  But I want the output should be as </p>
  
  <p><img src="https://i.stack.imgur.com/HGFj9.jpg" alt="enter image description here"></p>
  
  <p>Here Only one id is showing I want all ID and all Model as a comperation..
  Please help me to find out I am using a table inside a listviw, I tried with Listview inside a Listview.. But not worked..</p>
  
  <p>I tried with increment the data means ID/Model with for loop as i+1 But its incrementing the value
  means I am expected as</p>
  
  <pre><code>    map.put("id", strOfferid);
      map.put("id1", strOfferid1);
      map.put("id2", strOfferid2);
      map.put("id3", strOfferid3);
  </code></pre>
  
  <p>But I am incrementing the value like</p>
  
  <pre><code>Model:XL1,XXL1/XL2,XXL2/XL3,XXL3
  </code></pre>
  
  <p>So any one please help Regarding this..</p>