title: Not able to parse JSON into a recyclerview
body: <p><a href="https://i.stack.imgur.com/ydpg8.png" rel="nofollow noreferrer">enter image description here</a> This is what I am getting with the help Sultan Mahmud help(he has posted below in the comment) . But from the code posted here I just get blank layout
  This is what I want
  <a href="https://i.stack.imgur.com/gNnOm.png" rel="nofollow noreferrer">enter image description here</a>
  I am trying to read the data from the JSON and parse them in android layout. The basic idea of this overall is I am trying to group the items by date. This means all the events occurred during that particular date is listed below it and that date is listed as a header.</p>
  
  <p>I also added the print statement inside JSON method to see whether the objects are added to it or not. And it turns out the object is added to the list. There might be some issue of setting the adapter or the way to call the adapter in JSON. Not sure though</p>
  
  <p>For this, I got the help from this post
  <a href="https://stackoverflow.com/questions/41447044/divide-elements-on-groups-in-recyclerview-or-grouping-recyclerview-items-say-by">Divide elements on groups in RecyclerView or Grouping Recyclerview items ,say by date</a></p>
  
  <p>I tried it with dummy data and it works fine. But when I read it from JSON file and trying to adopt in android I might have done some mistake.</p>
  
  <p>What I am doing is parseJSOn method is creating the object and adding into the ArrayList. And that ArrayList is passed into the hashmap? Is this the way to do? I have seen lots of tutorials posted about JSON parsing, but haven't really got the idea how to do when there are multiple view types in my case header and events</p>
  
  <p>Also, Can anyone help me how to implement onclick listener recycler view in my case? (In most of the case model is passed as reference for getting the position. so what would be in mine case?</p>
  
  <p>I have posted the code with an explanation. Any help is appreciated</p>
  
  <pre><code>import android.os.Bundle;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.util.Log;
  import android.widget.Adapter;
  
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.VolleyError;
  import com.android.volley.toolbox.JsonArrayRequest;
  import com.android.volley.toolbox.Volley;
  
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.ArrayList;
  import java.util.Date;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Locale;
  import java.util.Map;
  import java.util.TreeMap;
  
  import static java.util.stream.Collectors.toMap;
  
  public class MainActivity extends AppCompatActivity {
  
  
      @NonNull
      private List&lt;StreamItem&gt; myOptions = new ArrayList&lt;&gt;();
  
      /*
       In this we have collection of list of header and Event it means for each date
       list of events are added. I have two layout of them one of header and one for event.
  
       */
      List&lt;ListItem&gt; consolidatedList = new ArrayList&lt;&gt;();
  
  
      private RecyclerView mRecyclerView;
      private StreamArrayAdapter adapter;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  
          mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
          mRecyclerView.setHasFixedSize(true);
  
          /*
          what I am doing is I am calling the parsJSON method what it does is it create the object for my model and add them in list
           */
  
          parseJSON();
  
          /*
          This the dummy data I tried it word as fine and group the datas by date
           */
  
         /* myOptions.add(new StreamItem("name 1", "2016-06-21"));
          myOptions.add(new StreamItem("name 2", "2016-06-05"));
          myOptions.add(new StreamItem("name 2", "2016-06-05"));
          myOptions.add(new StreamItem("name 3", "2016-05-17"));
          myOptions.add(new StreamItem("name 3", "2016-05-17"));
          myOptions.add(new StreamItem("name 3", "2016-05-17"));
          myOptions.add(new StreamItem("name 3", "2016-05-17"));
          myOptions.add(new StreamItem("name 2", "2016-06-05"));
          myOptions.add(new StreamItem("name 3", "2016-05-17"));*/
  
          HashMap&lt;String, List&lt;StreamItem&gt;&gt; groupedHashMap = groupDataIntoHashMap(myOptions);
  
  
          for (String date : groupedHashMap.keySet()) {
              HeaderItem dateItem = new HeaderItem();
              dateItem.setDate(date);
              consolidatedList.add(dateItem);
  
  
              for (StreamItem pojoOfJsonArray : groupedHashMap.get(date)) {
                  EventItem generalItem = new EventItem();
                  generalItem.setStreamItem(pojoOfJsonArray);//setBookingDataTabs(bookingDataTabs);
                  consolidatedList.add(generalItem);
              }
          }
  
          adapter = new StreamArrayAdapter(this, consolidatedList);
          LinearLayoutManager layoutManager = new LinearLayoutManager(this);
          layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
          mRecyclerView.setLayoutManager(layoutManager);
          mRecyclerView.setAdapter(adapter);
  
      }
  
  
  
  
  
      private HashMap&lt;String, List&lt;StreamItem&gt;&gt; groupDataIntoHashMap(List&lt;StreamItem&gt; listOfPojosOfJsonArray) {
  
          HashMap&lt;String, List&lt;StreamItem&gt;&gt; groupedHashMap = new HashMap&lt;&gt;();
  
          for (StreamItem pojoOfJsonArray : listOfPojosOfJsonArray) {
  
              String hashMapKey = pojoOfJsonArray.getDate();
  
              if (groupedHashMap.containsKey(hashMapKey)) {
                  // The key is already in the HashMap; add the pojo object
                  // against the existing key.
                  groupedHashMap.get(hashMapKey).add(pojoOfJsonArray);
              } else {
                  // The key is not there in the HashMap; create a new key-value pair
                  List&lt;StreamItem&gt; list = new ArrayList&lt;&gt;();
                  list.add(pojoOfJsonArray);
                  groupedHashMap.put(hashMapKey, list);
              }
          }
  
  
          return groupedHashMap;
      }
  
  
          private void parseJSON() {
              final List&lt;StreamItem&gt; events = new ArrayList&lt;&gt;();
  
              String url = "https://netsync.unl.edu/feeds/apps/capitol_live/";
  
  
              JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(url, new Response.Listener&lt;JSONArray&gt;() {
  
                  @Override
                  public void onResponse(JSONArray response) {
  
  
                      for (int i = 0; i &lt; response.length(); i++) {
  
                          try {
                              JSONObject e = response.getJSONObject(i);
                              String date = e.getString("streamStart");
  
  
                              String des = e.getString("desc");
  
                              String image = e.getString("imgName");
                              String title = e.getString("category");
  
  
                              StreamItem str = new StreamItem(date, title, des, image);
  
  
  
                              myOptions.add(str);
  
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
  
                      }
  
                      adapter.notifyDataSetChanged();
  
  
                  }
              }, new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
  
                      Log.e("Volley", error.toString());
  
  
                  }
              });
  
              RequestQueue requestQueue = Volley.newRequestQueue(this);
              requestQueue.add(jsonArrayRequest);
  
  
  
  
      }
  }
  
  enter code here
  </code></pre>
  
  <p>This is my data model POJO </p>
  
  <pre><code>public class StreamItem {
  
      public String date;
      public String title;
      public String desc;
      public String image;
      public String url;
  
  
  
   public StreamItem(String date , String title , String desc , String image , String url) {
          this.date = date;
          this.title = title;
          this.desc = desc;
          this.image = image;
          this.url = url;
      }
  
  
  
    public String getUrl(){
        return url;
  
      }
  
      public void setUrl(String url){
        this.url = url;
      }
  
  
      public String getDate() {
          return date;
      }
  
      public void setDate(String date) {
          this.date = date;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
  
  
      public String getDesc() {
          return desc;
      }
  
      public void setDesc(String desc) {
          this.desc = desc;
      }
  
      public String getImage() {
          return image;
      }
  
      public void setImage(String image) {
          this.image = image;
      }
  
  
  }
  </code></pre>