Menus
The top-right area of the toolbar is reserved for the toolbar’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 menu will require a few string resources. Add them to strings.xml (Listing 13.3) now. These strings may seem mysterious at this point, but it is good to get them taken care of. When you need them later, they will already be in place, and you will not have to stop what you are doing to add them.
Listing 13.3 Adding strings for menus (res/values/strings.xml
)
<resources> ... <string name="date_picker_title">Date of crime:</string> ...
Get Android Programming: The Big Nerd Ranch Guide, Third Edition 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.