title: Parsing JSON in android using Volley and StringRequest
body: <p>I am trying to parse a JSON object to listview in android.</p>
  
  <pre><code>       final ProgressDialog progressDialog = new ProgressDialog(this);
      progressDialog.setMessage("Loading Data..");
      progressDialog.show();
  
      StringRequest stringRequest = new StringRequest(Request.Method.GET,
              URL_DATA,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String s) {
                      progressDialog.dismiss();
                      try {
  
                          JSONArray array = new JSONArray(s);
  
                          for (int i=0; i&lt;= array.length(); i++){
                              JSONObject o = array.getJSONObject(i);
                              ListItem item = new ListItem(
                                      o.getString("name"),
                                      o.getString("realname"),
                                      o.getString("team"),
                                      o.getString("firstappearance"),
                                      o.getString("createdby"),
                                      o.getString("publisher"),
                                      o.getString("imageurl"),
                                      o.getString("bio")
                              );
                              listItems.add(item);
                          }
                          adapter = new MyAdapter(listItems, getApplicationContext());
                          recyclerView.setAdapter(adapter);
                      } catch (JSONException e) {
                          e.printStackTrace();
                      }
                  }
              }
              , new Response.ErrorListener() {
  
          @Override
          public void onErrorResponse(VolleyError error) {
              progressDialog.dismiss();
              Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show();
          }
      });
  
      RequestQueue requestQueue = Volley.newRequestQueue(this);
      requestQueue.add(stringRequest);
  </code></pre>
  
  <p>This is the function i am using to parse JSON using volley.
  App is running and no error was thrown but the view was empty and when i used static data instead of JSON the data was displayed in expected format. </p>
  
  <p>JSON link is <a href="https://simplifiedcoding.net/demos/marvel/index.php" rel="nofollow noreferrer">https://simplifiedcoding.net/demos/marvel/index.php</a></p>