AppCompat Default App Bar

CriminalIntent already has a simple app bar in place (Figure 14.2).

Figure 14.2  The app bar

The app bar

This is because Android Studio sets all new projects up to include an app bar by default for all activities that extend from AppCompatActivity. It does this by:

  • adding the Jetpack AppCompat foundation library dependency

  • applying one of the AppCompat themes that includes an app bar

Open your app/build.gradle file to see the AppCompat dependency:

    dependencies {
        ...
        implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
        ...

AppCompat is short for application compatibility. The Jetpack ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.