Chapter     5

Android UI Local Menus: The ContextMenu Class and PopupMenu Class

In this fifth chapter, we will take a look at the other two major types of menu systems in Android: the context menu and the pop-up menu, in the form of the ContextMenu Java interface, and the PopupMenu class.

I’m calling these two menu structure types “local” menus in this chapter’s title because these menus are local to a UI element or View widget itself, and are in fact directly invoked by clicking (PopupMenu), or long-clicking (ContextMenu), on the UI element widget View object that the menu affects.

In fact one of these local menuing types, the PopupMenu class, is actually implemented in Android as a UI widget, as you will learn a little bit later on in this ...

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