Chapter 2
Menus, Lists, and Notifications
In This Chapter
Building options menus and context menus
Connecting lists with activities
Adding notifications to the status bar
Sure, I wish I were down at my favorite cheap restaurant, ordering something that a gourmet would never eat. Alas, I am not. As much as I would prefer to talk about menus dealing with food, I’m actually going to talk about menus inside an Android application!
All about Menus
Android provides several ways for you to add menus to your applications. With Android’s help, you can add the following types of menus:
-
Options menu: An activity’s options menu is the activity’s main menu. On a device running Android 3.0 or greater, the options menu is a bunch of icons on the activity’s action bar. The action bar normally appears across the top of the activity screen. (See Figure 2-1.)
On a pre-Honeycomb device, items in the options menu appear when the user presses the Menu key. (See Figure 2-2.)
-
Context menu: A context menu is a list of menu items. The list appears when a user long-presses something. (See Figure 2-3.)
Context menus come in two flavors — the floating context menu (Figure 2-3) and the contextual action ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access