Chapter 7. Working with Menus

The Android SDK offers extensive support for menus. In this chapter, you'll learn to work with several of the menu types that Android supports: regular menus, submenus, context menus, icon menus, secondary menus, and alternative menus. Android 3.0 introduced something called an action bar that integrates well with menu items. This action bar and menu interaction is covered in chapter 30.

In Android, menus, in addition to being Java objects, are also represented as resources. Because they are resources, the Android SDK allows you to load menus from XML files, like other resources. Android generates resource IDs for each of the loaded menuitems. We will cover these XML menu resources in detail in this chapter. We will ...

Get Pro Android 3 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.