title: How to create a table from json encoded data from RestAPI?
body: <p>I am trying to create a simple table on MainActivity from json data from wordpress RestAPI. I have been able to get the "title" and "id". But I am having problems constructing a table.</p>
  
  <p>The json data looks loke:</p>
  
  <pre><code>{
  "id": 807,
  "date": "2018-08-18T19:06:52",
  "date_gmt": "2018-08-18T13:36:52",
  "guid": {
      "rendered": "http://wordpresssite.com/?page_id=807"
  },
  "modified": "2019-04-27T14:32:50",
  "modified_gmt": "2019-04-27T09:02:50",
  "slug": "sample-post",
  "status": "publish",
  "type": "page",
  "link": "http://wordpresssite.com/sample-page/",
  "title": {
      "rendered": "Test results"
  },
  "content": {
      "rendered": "&lt;div class=\"entry\"&gt;\n&lt;p&gt;Check out &lt;strong&gt;Current data&lt;/strong&gt; &amp;amp; &lt;strong&gt;Previous Data&lt;/strong&gt; here. Among the others, &lt;strong&gt;data&lt;/strong&gt; usually is declared first. This page is entirely dedicated to update you with &lt;strong&gt;test data&lt;/strong&gt;.&lt;/p&gt;\n&lt;/script&gt;&lt;/p&gt;\n&lt;p&gt;&amp;nbsp;&lt;/p&gt;\n&lt;h2 style=\"text-align: center;\"&gt;data&lt;/h2&gt;\n\n&lt;table id=\"tablepress-5\" class=\"tablepress tablepress-id-5\"&gt;\n&lt;thead&gt;\n&lt;tr class=\"row-1 odd\"&gt;\n\t&lt;th class=\"column-1\"&gt;Date&lt;/th&gt;&lt;th class=\"column-2\"&gt;First Round&lt;/th&gt;&lt;th class=\"column-3\"&gt;Second Round&lt;/th&gt;\n&lt;/tr&gt;\n&lt;/thead&gt;\n&lt;tbody class=\"row-hover\"&gt;\n&lt;tr class=\"row-2 even\"&gt;\n\t&lt;td class=\"column-1\"&gt;09/05/19&lt;/td&gt;&lt;td class=\"column-2\"&gt;98&lt;/td&gt;&lt;td class=\"column-3\"&gt;21&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr class=\"row-3 odd\"&gt;\n\t&lt;td class=\"column-1\"&gt;08/05/19&lt;/td&gt;&lt;td class=\"column-2\"&gt;32&lt;/td&gt;&lt;td class=\"column-3\"&gt;91&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr class=\"row-4 even\"&gt;\n\t&lt;td class=\"column-1\"&gt;07/05/19&lt;/td&gt;&lt;td class=\"column-2\"&gt;74&lt;/td&gt;&lt;td class=\"column-3\"&gt;87&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr class=\"row-5 odd\"&gt;\n\t&lt;td class=\"column-1\"&gt;05/05/19&lt;/td&gt;&lt;td class=\"column-2\"&gt;20&lt;/td&gt;&lt;td class=\"column-3\"&gt;27&lt;/td&gt;\n&lt;/tr&gt;\n&lt;tr class=\"row-6 even\"&gt;\n\t&lt;td
  </code></pre>
  
  <p>This is how I did for title:</p>
  
  <pre><code>StringRequest request = new StringRequest(Request.Method.GET, url, new Response.Listener&lt;String&gt;() {
          @Override
          public void onResponse(String s) {
              gson = new Gson();
              list = (List) gson.fromJson(s, List.class);
              postTitle = new String[list.size()];
  
              for(int i=0;i&lt;list.size();++i){
                  mapPost = (Map&lt;String,Object&gt;)list.get(i);
                  mapTitle = (Map&lt;String, Object&gt;) mapPost.get("title");
                  postTitle[i] = (String) mapTitle.get("rendered");
              }
  
              postList.setAdapter(new ArrayAdapter(MainActivity.this,android.R.layout.simple_list_item_1,postTitle));
  
          }
      },
  </code></pre>