O'Reilly logo

Android Application Development For Dummies, 2nd Edition by Donn Felker, Michael Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding Options and Context Menus

Android provides a simple mechanism for you to add menus to your applications. You find the following types of menus:

check.png Options menu or action bar menu: This is, most likely, the most common type of menu that you’ll work with. It’s the primary menu for an activity or fragment.

On Android 3.x and later, the Options menu is in the action bar at the top of the screen (read more about the action bar in Chapter 1). On Android 2.x and earlier, the Options menu is presented to the user with the press of the Menu key on the device. Figure 10-1 shows the same menus on two different devices.

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, and they’re the only menu items that support the use of icons. They don’t support check boxes or radio buttons.

Expanded: The expanded menu is a list of menu items that goes beyond the six menu items on the Icon menu. This menu is presented by the More menu icon that is automatically placed onscreen when the app developer has more items than will fit on the Icon menu.

Figure 10-1: The options menu on an Android 2.x device (left), and on an Android 4.x device (right).

9781118417454-fg1001.eps

Context menu: A floating list of menu ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required