Android Programming The Big Nerd Ranch Guide, 3rd Edition

(Brent) #1
Using the AppCompat library

249

Listing 13.2  Using an AppCompat theme (res/values/styles.xml)





You will learn much more about styles and themes in Chapter 22.


Using AppCompatActivity


The final requirement to use the AppCompat library is to ensure that all of your activities subclass
AppCompatActivity. You have been using AppCompatActivity since Chapter 7 for the support
fragment implementation, so no changes are necessary.


If you have made any updates so far in this chapter, run CriminalIntent and ensure that the app does not
crash. You should see something similar to Figure 13.2.


Figure 13.2  The toolbar


Now it is time to add actions to the toolbar.


http://www.ebook3000.com

Free download pdf