Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Parse the JSON response which contains the two arraylist
    primarykey
    data
    text
    <p>I am having the response of one of webservice to get the feeds list and in that response i am getting the two array with the same name. The problem is that i am not able get the details of the inner array i.e. "ProfileName", "ImageUrl" etc.. </p> <p>I have tried the json parsing.</p> <p>Below is the response of JSON:</p> <blockquote> <pre><code> {"Status":true, "result": [ {"result": [ {"ProfileName":"followers5","ImageUrl":"http:\/\/192.168.0.1\/webservice2\/uploads\/81.png","Likes":3,"Hearts":2}, {"ProfileName":"followers5","VideoUrl":"http:\/\/192.168.0.1\/webservice2\/uploads\/81.mp4","Likes":0,"Hearts":0} ]} ,{"result":[ {"ProfileName":"followers6","ImageUrl":"http:\/\/192.168.0.1\/webservice2\/uploads\/82.png","Likes":0,"Hearts":2}, {"ProfileName":"followers6","VideoUrl":"http:\/\/192.168.0.1\/webservice2\/uploads\/82.mp4","Likes":0,"Hearts":0} ]} ] } </code></pre> </blockquote> <p>I have tried as below:</p> <blockquote> <pre><code> class feedtask extends AsyncTask&lt;String, Integer, String&gt; { @Override protected String doInBackground(String... params) { Httputils getmethod = new Httputils(); try { result = getmethod.Getrequest("feeds.php?uid=76"); System.out.println("Feeds Result---&gt;" + result); JSONObject jobj = new JSONObject(result); JSONArray ja = jobj.getJSONArray("result"); for (int i = 0; i &lt; ja.length(); i++) { for (int j = 0; j &lt;= i; j++) { JSONObject jo = ja.getJSONObject(j); abcd.add(jo.getString("ProfileName")); System.out.println("Profile Name---&gt;" + jo.getString("ProfileName")); } } } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } } </code></pre> </blockquote> <p>Please help me out to get the details of the second array.</p> <p>Any help will be appreciated.</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload