Example usage for android.support.v4.view MenuItem getGroupId

List of usage examples for android.support.v4.view MenuItem getGroupId

Introduction

In this page you can find the example usage for android.support.v4.view MenuItem getGroupId.

Prototype

public int getGroupId();

Source Link

Document

Return the group identifier that this menu item is part of.

Usage

From source file:com.actionbarsherlock.internal.view.menu.MenuBuilder.java

void setExclusiveItemChecked(MenuItem item) {
    final int group = item.getGroupId();

    final int N = mItems.size();
    for (int i = 0; i < N; i++) {
        MenuItemImpl curItem = mItems.get(i);
        if (curItem.getGroupId() == group) {
            if (!curItem.isExclusiveCheckable())
                continue;
            if (!curItem.isCheckable())
                continue;

            // Check the item meant to be checked, uncheck the others (that are in the group)
            curItem.setCheckedInt(curItem == item);
        }/*from www.j a  va  2s .  c  om*/
    }
}