Understanding Android Menus

The key class in Android menu support is android.view.Menu. Every activity in Android is associated with one menu object of this type. The menu object then contains a number of menu items and submenus.

Menu items are represented by android.view.MenuItem. Submenus are represented by android.view.SubMenu. These relationships are graphically represented in Figure 7–1. Strictly speaking, this is not a class diagram but a structural diagram designed to help you visualize the relationships between various menu-related classes and functions.

Image

Figure 7–1. Structure of Android menu-related classes

Figure 7–1 illustrates that ...

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

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