Second Edition Errata


#1

Howdy! Chris Stewart here. One of the authors of the 2nd edition.

I will try my best to capture errata from the 2nd edition of the book in this post organized by chapter. If you spot anything, please make a new post about it in the chapter-specific forums. I’ll keep a summary here.

Last Updated: 7/24/2016

##2nd Edition, 2nd Printing

9. RecyclerView
In figure 9.11 Custom List Item Layout (list_item_crime.xml): The RelativeLayout should have wrap_content set as the android:layout_height. If match_parent is used, as it is in the book, the rows in the RecyclerView will be the same height as the RecyclerView itself. There was a recent change in how RecyclerView works that made this an issue (it wasn’t always a problem!).

##2nd Edition, 1st Printing
The 2nd printing of the book has been released and fixes all of the issues that you see below. This pdf includes ALL of the changed pages from the 1st printing to the 2nd printing.

https://github.com/bignerdranch/AndroidCourseResources/blob/master/2ndEdition/2ndPrinting/Android_2.2_changes.pdf

2nd Edition, 1st Printing Addendum:
The addendum includes the most important changes below in more detail, with pictures, and is easily printable.
https://github.com/bignerdranch/AndroidCourseResources/raw/master/2ndEdition/Errata/2eAddendum.pdf

Chapter Errata:

All

  • Always use “Empty Activity” and never use “Blank Activity” when creating a new project or Activity. Blank Activity comes with extra code that you do not need. What you see in the book will match the empty activity template except for one difference:

The empty activity template does not include a menu. The onCreateOptionsMenu and onOptionsItemSelected methods won’t be there (just leave them out of your own code even if you see them in the book). Also, a menu file in res/menu/ will not exist as well. Do not worry about this difference. You will not need the menu system until you get to the Toolbar chapter. In that chapter, the menu system will be fully explained.

5. Your Second Activity

  • In the sentence before Listing 5.10 - “Speaking of other code, use this new method in CheatActivity’s cheat button listener now.” CheatActivity should be QuizActivity.

20. Styles and Themes


android:colorBackground not working in KitKat
Only the first crime shown in crime list
GeoQuiz Questions no longer visible after adding the landscape layout
Activity_quiz code has move to content_quiz
Large gaps between crime list items
#2

I’m unable to edit the errata post with our new forum system, but there is one new piece of errata that is an issue in all versions of the book!

9. RecyclerView
In figure 9.11 Custom List Item Layout (list_item_crime.xml): The RelativeLayout should have wrap_content set as the android:layout_height. If match_parent is used, as it is in the book, the rows in the RecyclerView will be the same height as the RecyclerView itself. There was a recent change in how RecyclerView works that made this an issue (it wasn’t always a problem!).


RelativeLayout dimensions in list_item_crime.xml
[HELP] Only one ViewHolder is being shown
[Solved] Why are the elements on the list of crimes widely separated from each other?
#3

Thank you Chris! This one threw me off for a few days.


#4

On page 17 there is still an error even after looking at the corrected PDF that was posted. The book and the correct PDF show two imports in Listing 1.4 that are not there in real life. They are:
import android.view.Menu;
import android.view.MenuItem;


Figure 9.12 listing problem
#5