code: public void removeAdapterItemAt(int index) {
          PickerSpinnerAdapter adapter = (PickerSpinnerAdapter) getAdapter();
          int count = adapter.getCount();
          int selection = getSelectedItemPosition();
  
          // check which item will be removed:
          if(index == count) // temporary selection
              selectTemporary(null);
          else if (index == count-1 && adapter.hasFooter()) { // footer
              if(selection == count)
                  setSelectionQuietly(selection - 1);
              adapter.setFooter(null);
          } else { // a normal item
              // keep the right selection in either of these cases:
              if(index == selection) { // we delete the selected item and
                  if(index == getLastItemPosition())  // it is the last real item
                      setSelection(selection - 1);
                  else {
                      // we need to reselect the current item
                      // (this is not guaranteed to fire a selection callback when multiple operations
                      // modify the dataset, so it is a lot better to first select the item you want
                      // to have selected, best by overriding this method in your subclass).
                      setSelectionQuietly(index==0 && count>1? 1 : 0);
                      setSelection(selection);
                  }
              }
              else if(index < selection && selection!=count) // we remove an item above it
                  setSelectionQuietly(selection - 1);
              adapter.remove(adapter.getItem(index));
              if(selection == count) { // we have a temporary item selected
                  reselectTemporaryItem = true;
                  setSelectionQuietly(selection - 1);
              }
          }
      }
docs: Removes the specified item from the adapter and takes care of handling selection changes.
  Always call this method instead of getAdapter().remove().
  Note that if you remove the selected item here, it will just reselect the next one instead of
  creating a temporary item containing the current selection.
  @param index The index of the item to be removed.