May 2022
Intermediate to advanced
688 pages
20h 12m
English
The top-right area of the app bar is reserved for the app bar’s menu. The menu consists of action items (sometimes 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 need a string resource for its label. Open res/values/strings.xml and add a string label describing your new action.
Listing 15.1 Adding a string for menu (res/values/strings.xml)
<resources>
...
<string name="crime_solved_label">Solved</string>
<string name="new_crime">New Crime</string>
</resources>
The action item also needs an icon. Just like when you added a right arrow icon back in Chapter 2, you will ...
Read now
Unlock full access