Errata

Learning Android

Errata for Learning Android

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
1
"A blank Activity and associated layout"

Following the author steps using the latest Android Studio, when creating a blank activity he replaces the "AppCompatActivity" library with the Activity one. Despite it seems he wanted to show the ability of changing the class and the Studio automatically changes the import, for the latest it doesn't happen. Also, if I change the class to Activity, and call the correct import, it will get an error building the app for the first time because there is a method call "setSupportActionBar" that related to AppCompatActivity and not Activity.

I'm experienced programmer and it is easier to find that out, but for less experienced, it could be quite difficult to understand how to fix this.

Note from the Author or Editor:
The comment is correct. The errata should point out that if the current version of Android Studio does not automatically change the import statements, then the developer needs to do it manually, along with replacing getSupportActionBar with getActionBar. As an alternative, the developer can simply use the AppCompatActivity without changing to Activity.

Tiago M. Vieira  Aug 04, 2016