示例#1
0
  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);
    }
  }
示例#2
0
 public void removeItemAt(int index) {
   removeItemAtInt(index, true);
 }
示例#3
0
 public void removeItem(int id) {
   removeItemAtInt(findItemIndex(id), true);
 }