public void removeGroup(int group) {
    final int i = findGroupIndex(group);

    if (i >= 0) {
      final int maxRemovable = mItems.size() - i;
      int numRemoved = 0;
      while ((numRemoved++ < maxRemovable) && (mItems.get(i).getGroupId() == group)) {
        // Don't force update for each one, this method will do it at the end
        removeItemAtInt(i, false);
      }

      // Notify menu views
      onItemsChanged(true);
    }
  }
 public void removeItemAt(int index) {
   removeItemAtInt(index, true);
 }
 public void removeItem(int id) {
   removeItemAtInt(findItemIndex(id), true);
 }