title: Unable to add separator in list view
body: <p>This is my code </p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.email_list_main);
  
          emailResults = new ArrayList&lt;GetEmailFromDatabase&gt;();
  
          //int[] colors = {0,0xFFFF0000,0};
          //getListView().setDivider(new GradientDrawable(Orientation.RIGHT_LEFT, colors));
          //getListView().setDividerHeight(2);
  
          emailListFeedAdapter = new EmailListFeedAdapter(this, R.layout.email_listview_row, emailResults);
          setListAdapter(this.emailListFeedAdapter);
  
          getResults();
          if(emailResults != null &amp;&amp; emailResults.size() &gt; -1){
              emailListFeedAdapter.notifyDataSetChanged();
          for(int i=0;i&lt; emailResults.size();i++){
              try {
  </code></pre>
  
  <p>Here I getting email Sent date</p>
  
  <pre><code>                emailListFeedAdapter.add( emailResults.get(i));
  
                  datetime_text1 = emailResults.get(i).getDate();
                  formatter1 = new SimpleDateFormat();
                  formatter1 = DateFormat.getDateInstance((DateFormat.MEDIUM));
  
                  Calendar currentDate1 = Calendar.getInstance();
  
                  Item_Date1 = formatter1.parse(datetime_text1);
                  current_Date1 = formatter1.format(currentDate1.getTime());
                  current_System_Date1 = formatter1.parse(current_Date1);
  
                  currentDate1.add(Calendar.DATE, -1);
  
                  yesterdaydate = formatter1.format(currentDate1.getTime());
                  yeaterday_Date = formatter1.parse(yesterdaydate);
  
                  currentDate1.add(Calendar.DATE, -2);
  
                  threeDaysback = formatter1.format(currentDate1.getTime());
                  Three_Days_Back = formatter1.parse(threeDaysback);
  </code></pre>
  
  <p>Here I am comparing current date with list view item date, and here is my problem, dates are matching but it is not adding separator I tried in so many ways but nothing worked the code for separator is bellow.   </p>
  
  <pre><code>                if(Item_Date.compareTo(current_System_Date)==0){
                      if(index1){
  
                         emailListFeedAdapter.addSeparatorItem("SEPARATOR");
                         //i--;
                         index1=false;
                      }
  
  
                  }
                  else if(yeaterday_Date.compareTo(Item_Date1)==0){
                      if(index2){
                         emailListFeedAdapter.addSeparatorItem("SEPARATOR");
                         //i--;
                         index2 = false;
                      }
  
                  }
                  else if(Item_Date1.compareTo(Three_Days_Back)==0){
                      if(index3){
                         emailListFeedAdapter.addSeparatorItem("SEPARATOR");
                         //i--;
                         index3 = false;
                      }
  
                  }
                  } catch (ParseException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
          }
       }
  }
  </code></pre>
  
  <p>In EmailListFeedAdapter</p>
  
  <pre><code>     private TreeSet&lt;Integer&gt; mSeparatorsSet = new TreeSet&lt;Integer&gt;();
       public void addSeparatorItem(final String item) {
           //itemss.add(emailResults.get(0));
              // save separator position
              mSeparatorsSet.add(itemss.size() - 1);
              notifyDataSetChanged();
          }
      @Override
      public int getItemViewType(int position) {
           return mSeparatorsSet.contains(position) ? TYPE_SEPARATOR : TYPE_ITEM;
         }
           holder = new ViewHolder();
          switch (type) {
  
              case TYPE_ITEM:
                   emailView= inflater.inflate(R.layout.email_listview_row, null);
  
                  break;
              case TYPE_SEPARATOR:
                   emailView= inflater.inflate(R.layout.item2, null);
                   holder.textView = (TextView)emailView.findViewById(R.id.textSeparator);
                   emailView.setTag(holder);
                   holder.textView.setText("SEPARATOR");
                  break;
          }
  </code></pre>
  
  <p>Here is ViewHolder class</p>
  
  <pre><code>       public static class ViewHolder {
          public TextView textView;
      }
  </code></pre>
  
  <p>if anybody knows then please tell me where I am doing wrong.</p>
  
  <p>Thanx</p>