Chapter 5. Working with Menus and Dialogs

In Chapter 3, we introduced you to resources, content providers, and intents—the foundations of the Android SDK. Then we covered UI controls and layouts in Chapter 4. In this chapter, we'll show you how to work with Android menus and dialogs.

The Android SDK offers extensive support for menus and dialogs. 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.

In Android, menus are represented as resources. As resources, the Android SDK allows you to load menus from XML files, like other resources. Android generates resource IDs for each of the loaded menu items. We will cover these ...

Get Pro Android 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.