title: How to add multiple header views in a ListView
body: <p>I've a custom adapter for my <code>ListView</code> I want to add project names as the headers to my work requests. Adding a single header works just fine but I'm not sure how to add multiple headers using <code>addHeaderView</code>. I don't understand where exactly to place <code>setAdapter</code> or is it supposed to be placed multiple times? </p>
  
  <p>This is my java code for a single header which works:</p>
  
  <pre><code>mListView = (ListView)findViewById(R.id.dashboardList);
  View header1 =  getLayoutInflater().inflate(R.layout.listview_header, null, false);
  tv = (TextView) header1.findViewById(R.id.listHeader);
  adapter = new MyCustomAdapter(MyDashboardActivity.this, R.layout.mydashboard_row, dashboardBean);
  tv.setText("Project 1");
  mListView.addHeaderView(header1, null, false);
  for (int i=0; i &lt; 7; i++) {
       dashboardBean.add(new DashboardBean(workRequests[i],status[i],actualHours[i]));
  }
  mListView.setAdapter(adapter);
  </code></pre>
  
  <p>Now, I for two headers I tried this: </p>
  
  <pre><code>mListView = (ListView)findViewById(R.id.dashboardList);
  View header1 =  getLayoutInflater().inflate(R.layout.listview_header, null, false);
  tv = (TextView) header1.findViewById(R.id.listHeader);
  adapter = new MyCustomAdapter(MyDashboardActivity.this, R.layout.mydashboard_row, dashboardBean);
  tv.setText("RxOffice");
  mListView.addHeaderView(header1, null, false);
  for (int i=0; i &lt; 4; i++) {
       dashboardBean.add(new DashboardBean(workRequests[i],status[i],actualHours[i])); 
  }
  
  tv.setText(Project 2");
  
  mListView.addHeaderView(header1, null, false);
  for (int i=4; i &lt; workRequests.length; i++) {
       dashboardBean.add(new DashboardBean(workRequests[i],status[i],actualHours[i]));
  }
  mListView.setAdapter(adapter);
  </code></pre>
  
  <p>But this doesn't work! It gives me only the Project 2 header and all 7 entries below it. Could anyone please tell me what's wrong? I'm guessing it has something to do with <code>setAdapter</code>. Thanks!</p>