code: @Override public int getItemViewType(int position) {
      int viewType = TYPE_ITEM;
      if (isHeaderPosition(position)) {
        viewType = TYPE_HEADER;
      } else if (isFooterPosition(position)) {
        viewType = TYPE_FOOTER;
      }
      return viewType;
    }
docs: Returns the type associated to an item given a position passed as arguments. If the position
  is related to a header item returns the constant TYPE_HEADER or TYPE_FOOTER if the position is
  related to the footer, if not, returns TYPE_ITEM.
  
  If your application has to support different types override this method and provide your
  implementation. Remember that TYPE_HEADER, TYPE_ITEM and TYPE_FOOTER are internal constants
  can be used to identify an item given a position, try to use different values in your
  application.