public void swapPositions(List<?> list,int from,int to){
  if (customHeaderView != null) {
    from--;
    to--;
  }
  Collections.swap(list,from,to);
}

public void swapPositions ( List < ? > list , int from , int to ) { if ( customHeaderView != null ) { from -- ; to -- ; } Collections . swap ( list , from , to ) ; }
swap the item of list
