The top-right area of the app bar is reserved for the app bar’s menu. The menu consists of action items (sometimes also referred to as menu items), which can perform an action on the current screen or on the app as a whole. You will add an action item to allow the user to create a new crime.
Your new action item will require a string resource for its label. Open res/values/strings.xml and add a string label describing your new action.
Listing 14.1 Adding a string for menu (
<resources> ... <string name="crime_solved_label">Solved</string> <string name="new_crime">New Crime</string> </resources>
Defining a menu in XML
Menus are a type of resource, similar to layouts. You create an ...