In this section, you will use what you have learned about menus, compatibility, and alternative resources to add a menu item that lets users show and hide the subtitle of CrimeListActivity’s action bar.
A menu item that applies the action bar should not be visible to users without an action bar. So the first step is to create an alternative menu resource. Create a menu-v11 folder in your project’s res directory. Then copy and paste fragment_crime_list.xml into this folder.
In res/menu-v11/fragment_crime_list.xml, add a menu item that will read Show Subtitle and will appear on the action bar if there is room.
Listing 16.14 Adding Show Subtitle menu item (