title: Remove divider between listview header and first item
body: <p>From the title of my question, my problem is clear. I have a custom listView and a header and some items. Ofcourse, I have added dividers between all the items. Only thing I don't want is the divider between header and the first item.
  However, below code is not working.. I also want to know the exact work of this line</p>
  
  <pre><code>list.setHeaderDividerEnabled(false);
  </code></pre>
  
  <p>I have searched and tried a lot also visited this links but no luck..</p>
  
  <p><a href="https://stackoverflow.com/questions/10119132/empty-space-between-listview-header-and-first-item">Empty space between listview header and first item</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21095214/android-listview-unwanted-space-between-header-view">Android listView unwanted space between header view</a></p>
  
  <p>Thanks in advance.</p>
  
  <p>Update!</p>
  
  <pre><code>public class ListView extends android.widget.ListView {
  
  private OnScrollListener onScrollListener;
  private Onscroll onscrollObj;
  
  public ListView(Context context) {
      super(context);
      onCreate(context, null, null);
  }
  
  public ListView(Context context, AttributeSet attrs) {
      super(context, attrs);
      onCreate(context, attrs, null);
  }
  
  public ListView(Context context, AttributeSet attrs, int defStyle) {
      super(context, attrs, defStyle);
      onCreate(context, attrs, defStyle);
  }
  
  @SuppressWarnings("UnusedParameters")
  private void onCreate(Context context, AttributeSet attrs, Integer defStyle) {
      setListeners();
  }
  
  private void setListeners() {
      super.setOnScrollListener(new OnScrollListener() {
  
          private int oldTop;
          private int oldFirstVisibleItem;
  
          @Override
          public void onScrollStateChanged(AbsListView view, int scrollState) {
              if (onScrollListener != null) {
                  onScrollListener.onScrollStateChanged(view, scrollState);
              }
          }
  
          @Override
          public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
              if (onScrollListener != null) {
                  onScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
              }
  
              if (onscrollObj != null) {
                  onDetectedListScroll(view, firstVisibleItem);
              }
          }
  
          private void onDetectedListScroll(AbsListView absListView, int firstVisibleItem) {
              View view = absListView.getChildAt(0);
              int top = (view == null) ? 0 : view.getTop();
  
              if (firstVisibleItem == oldFirstVisibleItem) {
                  if (top &gt; oldTop) {
                      onscrollObj.onUpScrolling();
                  } else if (top &lt; oldTop) {
                      onscrollObj.onDownScrolling();
                  }
              } else {
                  if (firstVisibleItem &lt; oldFirstVisibleItem) {
                      onscrollObj.onUpScrolling();
                  } else {
                      onscrollObj.onDownScrolling();
                  }
              }
  
              oldTop = top;
              oldFirstVisibleItem = firstVisibleItem;
          }
      });
  }
  
  @Override
  public void setOnScrollListener(OnScrollListener onScrollListener) {
      this.onScrollListener = onScrollListener;
  }
  
  public void setOnDetectScrollListener(Onscroll onDetectScrollListener) {
      this.onscrollObj = onDetectScrollListener;
  }
  }
  </code></pre>