Going à la Carte with Your Menu
In This Chapter
- Knowing great menus from bad ones
- Building an options menu
- Building a context menu
Okay, I don't mean that kind of menu. Sure, I wish I were down at my favorite Mexican restaurant, ordering some excellent chips and salsa, but I'm not. Instead, I'm talking about menus inside an Android application!
Android tablets provide a simple mechanism for you to add menus to your applications. You find the following types of menus:
- Action bar: The action bar is a new addition to Android 3.0. The action bar contains the most commonly used menu options you would encounter in a tablet application. These menu options, located in the upper-right side of the application screen, appear as icons with text or simply as text references to the action that they perform.
- Options menu: The options menu is the most common type of menu that you will work with because it is the primary menu for an activity. This menu is presented when a user presses the Menu key on the device. Within the options menu are two groups:
- Icon: These menu options are available at the bottom of the screen. The device supports up to six menu items — the only menu items that support the use of icons. They do not support check boxes or radio buttons, however.
- Expanded: This group is a list of menu items beyond the original six menu items present in the Icon menu. When the user places more than six items on the Icon menu, the More menu icon appears onscreen. When you click ...