18Context Menus and Contextual Action Mode

In this chapter, you will enable users to delete crimes from the list by long-pressing a list item. Deleting a crime is a contextual action: it is associated with a particular view on screen (a single list item) rather than the entire screen.

On pre-Honeycomb devices, contextual actions are presented in a floating context menu. On later devices, a contextual action bar is the recommended way to present contextual actions. The contextual action bar appears on top of the activity’s action bar and presents actions to the user.

Figure 18.1  Long-pressing a list item to delete a crime

Long-pressing a list item to delete a crime

With options menus, managing ...

Get Android Programming: The Big Nerd Ranch Guide 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.