code: private void removeItemAtInt(int index, boolean updateChildrenOnMenuViews) {
          if ((index < 0) || (index >= mItems.size())) {
              return;
          }
  
          mItems.remove(index);
  
          if (updateChildrenOnMenuViews) {
              onItemsChanged(true);
          }
      }
docs: Remove the item at the given index and optionally forces menu views to update.
  
  @param index                     The index of the item to be removed. If this index is
  invalid an exception is thrown.
  @param updateChildrenOnMenuViews Whether to force update on menu views. Please make sure you
  eventually call this after your batch of removals.