Lines Matching refs:menu
19 import com.android.internal.view.menu.MenuItemImpl;
38 * This class is used to instantiate menu XML files into Menu objects.
40 * For performance reasons, menu inflation relies heavily on pre-processing of
50 private static final String XML_MENU = "menu";
72 * Constructs a menu inflater.
83 * Constructs a menu inflater.
96 * Inflate a menu hierarchy from the specified XML resource. Throws
100 * <code>R.menu.main_activity</code>)
101 * @param menu The Menu to inflate into. The items and submenus will be
104 public void inflate(int menuRes, Menu menu) {
110 parseMenu(parser, attrs, menu);
112 throw new InflateException("Error inflating menu XML", e);
114 throw new InflateException("Error inflating menu XML", e);
121 * Called internally to fill the given menu. If a sub menu is seen, it will
124 private void parseMenu(XmlPullParser parser, AttributeSet attrs, Menu menu)
126 MenuState menuState = new MenuState(menu);
133 // This loop will skip to the menu start tag
143 throw new RuntimeException("Expecting menu, got " + tagName);
162 // A menu start tag denotes a submenu for an item
242 "Couldn't resolve menu item onClick handler " + methodName +
281 * State for the current menu.
283 * Groups can not be nested unless there is another menu (which will have
287 private Menu menu;
345 public MenuState(final Menu menu) {
346 this.menu = menu;
492 MenuItem item = menu.add(groupId, itemId, itemCategoryOrder, itemTitle);
499 SubMenu subMenu = menu.addSubMenu(groupId, itemId, itemCategoryOrder, itemTitle);