public void remove(List<?> list,int position){
  if (list.size() > 0) {
    list.remove(customHeaderView != null ? position - 1 : position);
    notifyItemRemoved(position);
  }
}

public void remove ( List < ? > list , int position ) { if ( list . size ( ) > 0 ) { list . remove ( customHeaderView != null ? position - 1 : position ) ; notifyItemRemoved ( position ) ; } }
remove a item of the list of the adapter
