title: Set data in expandable listview android form JSON format
body: <p>I have following pattern of <code>JSON</code></p>
  
  <pre><code>{
  "menu": [{
      "id": "74",
      "parent_id": "0",
      "title": "Mobiles &amp; Tablets",
      "menu_type": "7",
      "menu_icon_image": "",
      "link": "#",
      "childs": [{
          "id": "75",
          "parent_id": "74",
          "title": "Mobile Phones",
          "menu_type": "7",
          "menu_icon_image": "",
          "link": "categories/mobile-tablets"
      }, {
          "id": "76",
          "parent_id": "74",
          "title": "Mobile Accessories",
          "menu_type": "7",
          "menu_icon_image": "",
          "link": "#"
      }, {
          "id": "77",
          "parent_id": "74",
          "title": "Tablets",
          "menu_type": "7",
          "menu_icon_image": "",
          "link": "#"
      }, {
          "id": "78",
          "parent_id": "74",
          "title": "Audio &amp; Video",
          "menu_type": "7",
          "menu_icon_image": "",
          "link": "#"
      }, {
          "id": "79",
          "parent_id": "74",
          "title": "Laptops",
          "menu_type": "7",
          "menu_icon_image": "",
          "link": "#"
      }]
  }, {
      "id": "80",
      "parent_id": "0",
      "title": "WOMEN",
      "menu_type": "7",
      "menu_icon_image": "",
      "link": "#",
      "childs": [{
          "id": "81",
          "parent_id": "80",
          "title": "GIRLS CLOTHING",
          "menu_type": "7",
          "menu_icon_image": "",
          "link": "categories/womens-clothing"
      }]
  }],
  "slider": [{
      "id": "56",
      "url": "#",
      "default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-itwQr56f76f6df2bea.png/88e5b614324080684af061c510496d29",
      "title": "Mobile Test Slider",
      "image": null,
      "days": null
  }, {
      "id": "55",
      "url": "#",
      "default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-uIXFZ56f76efbcd627.png/e5a0e22dcb0de1007c88c16db1aebb7f",
      "title": "Mobile Test Slider",
      "image": null,
      "days": null
  }, {
      "id": "52",
      "url": "#",
      "default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-QULkY56f7719eb0915.png/a4d0065b56b57b7d01d44873bbdb1df8",
      "title": "Mobile Test Slider",
      "image": null,
      "days": null
  }, {
      "id": "51",
      "url": "#",
      "default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-L0ROK56f7716acccf0.png/e194ea4403c4b4b7e17f1fecfa329f22",
      "title": "Mobiles &amp; Tablets",
      "image": null,
      "days": null
  }, {
      "id": "1",
      "url": "",
      "default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-qtvVk56f60fd0379b9.jpg/510c150029fd29d1d77b869d837b126e",
      "title": "Slider Add",
      "image": null,
      "days": null
  }],
  "advertise": [{
      "id": "54",
      "usrl": "categories/mobile-tablets",
      "default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/1-fl-IWkmH56f66a2b60bde.jpg/05571c3c78954e1a461b87bd62698273",
      "title": "Mobile phone home page advertise",
      "image": null,
      "days": null
  }, {
      "id": "53",
      "usrl": "categories/mobile-tablets",
      "default_image": "https://s3.amazonaws.com/atbdev/cache/advertis_img/3-fl-YK1pI56f5102a7237b.png/118b3074314006a62a7f10867a447be6",
      "title": "Mobile phone home page advertise",
      "image": null,
      "days": null
     }]
  
  }
  
  
  
    List&lt;ExpanTitelandTotal&gt; result1111 = new ArrayList&lt;ExpanTitelandTotal&gt;();
  
                      for (int i = 0; i &lt; menuArrayList.size(); i++) {
                          ExpanTitelandTotal mExpanTitelandTotal11 = new ExpanTitelandTotal();
                          mExpanTitelandTotal11.setTitle(menuArrayList.get(i).getTitle());
                          mExpanTitelandTotal11.setLink(menuArrayList.get(i).getLink());
                          mExpanTitelandTotal11.setId(Integer.parseInt(menuArrayList.get(i).getId()));
                          //result1111.add(mExpanTitelandTotal11);
                          if (mGetDrawerAndHome.getMenu().get(i).getChilds().size() &gt; 0) {
                              mExpanTitelandTotal11.setIsMultiple(true);
                              Log.d("mGetDrawerAndHome.getMenu().get(i).getChilds().size() ",String .valueOf(mGetDrawerAndHome.getMenu().get(i).getChilds().size()));
                              for (int j = 0; j &lt; mGetDrawerAndHome.getMenu().get(i).getChilds().size(); j++)
                              {
                                  Log.d("Sub Menu", mGetDrawerAndHome.getMenu().get(i).getChilds().get(j).getTitle());
  
                                  ExpanTitelandTotal mExpanTitelandTotal = new ExpanTitelandTotal();
                                  mExpanTitelandTotal.setTitle(mGetDrawerAndHome.getMenu().get(i).getChilds().get(j).getTitle());
                                  mExpanTitelandTotal.setLink(mGetDrawerAndHome.getMenu().get(i).getChilds().get(j).getLink());
                                  mExpanTitelandTotal.setId(Integer.parseInt(mGetDrawerAndHome.getMenu().get(i).getChilds().get(j).getId()));
                                  result1111.add(mExpanTitelandTotal);
  
                              }
                          } else {
                              mExpanTitelandTotal11.setIsMultiple(false);
                          }
                          mExpanTitelandTotal11.setItemList(result1111);
                          mArrayListExpanTitelandTotals.add(mExpanTitelandTotal11);
                      }
  
  
                      listAdapterTNA = new ExpandableListAdapterTNA(ActivityDrawer.this, mArrayListExpanTitelandTotals, mExpandableListView);
                      mExpandableListView.setAdapter(listAdapterTNA);
                      mExpandableListView.setIndicatorBounds(10, 80);
                      mExpandableListView.setDivider(null);
  </code></pre>
  
  <p>above is my code and when i run this i get following output
  <a href="https://i.stack.imgur.com/Wm67W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wm67W.png" alt="enter image description here"></a></p>
  
  <p>In expandable list view two different category data store in all main category data ? any idea how can i solve this ?</p>