Chapter  7

working with menus

Android SDK has extensive support for menus. It supports regular menus, submenus, context menus, icon menus, secondary menus, and alternative menus. Android 3.0, in addition, introduced the action bar, which integrates well with menu items. The action bar and menu interaction are covered in Chapter 10. Now Android 4.0 has introduced pop-up menus: menus that can be invoked at any time based on a button click or any other UI event.

In Android, menus, much like other resources, can be represented as both Java objects and entries in XML files. Android generates resource IDs for each of the loaded menu items. This chapter covers the XML menu resources in detail as well.

Being resources, all menu items take advantage ...

Get Pro Android 4 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.