4th Edition Errata

Hello! This post will contain the errata that is found in the 4th edition of the Android Programming Guide.

Is this where we flag issues? Or just for “vetted” errata (that are reported in some other manner)?

On page #28, false.setOnClickListener { view: View ->`

should be:
falseButton.setOnClickListener { view: View ->

I have the ebook it shows page 65 or 66
But it does look like a typo because a couple pages before pg 62 it is falseButton

1 Like

I’d forgotten there’s an ebook version and page numbers would be different - thanks for reminder :slight_smile:

1 Like

It helps to use the listing numbers instead. This is in reference to Listing 1.11.

1 Like

The title for Figure 22.8 says BeastBox instead of BeatBox.

I found some errata.

Chapter 6 (page: 126, printing version)

answerIsTrue = intent.getBooleanExtra(EXTRA_ANSWER_IS_TRUE, false)
-> answerIsTrue = getIntent().getBooleanExtra(EXTRA_ANSWER_IS_TRUE, false)

Chapter 6 (page: 127, printing version)

In MainActivity, modify cheatButton’s listener to call startActivityForResult(Intent, int).
-> startActivityForResult(Intent, Int).

Thank you for your nice book!

Hey there! Thanks for the keen eye.

The first one you mentioned is actually a feature of the new Kotlin APIs on Android. intent is now a property on the Activity class so it can be used instead of getIntent().

The int used in the startActivityForResult() code should definitely be Int though. Thanks for reporting it and I’m really happy to hear that you like the book!

Best,

Brian

Errata: page 196 (Printing version)

Before you dive in to ConstraintLayout, you must do a little legwork and learn a little background.
You will need a copy of that fancy handcuff image from Figure 10.1 in your project. Open
the solutions file (www.bignerdranch.com/solutions/AndroidProgramming4e.zip) and the
09_LayoutsAndWidgets/CriminalIntent/app/src/main/res directory. Copy each density version of
ic_solved.png into the appropriate drawable folder in your project.

09_LayoutsAndWidgets -> 10_LayoutsAndWidgets

Thank you for your nice book.

Errata: page 237(Printing version), Listing 11.17 in the chapter 11
private val crimeRepository = CrimeRepository.get()
-> private val crimeRepository = CrimeRepository.getCrimes()

Errata: page 165(Printing version), chapter 8

Moving on to the CheckBox, get a reference to it in onCreateView(…). Then, set a listener in onStart()
that will update the solvedCheckBox field of the Crime, as shown in Listing 8.10. Even though the
OnClickListener is not triggered by the state restoration of the fragment, putting it in onStart helps
keep all of your listeners in one place and easy to find.
Listing 8.10 Listening for CheckBox changes (CrimeFragment.kt)

solvedCheckBox field -> isSolved property

Listing 24.12

val flickrHomePageRequest : Call<String> = bnrInterface.fetchContents()

should be

val flickrHomePageRequest: Call<String> = flickrApi.fetchContents()

to match Listing 24.11

I cannot find the http://www.bignerdranch.com/solutions/AndroidProgramming4e.zip resource. It keeps giving me 404 error and I need the database from here.

So do I. When I try to open this link, it always says 404.

The file has been moved:

1 Like

In the Chapter 9 Challenge: RecyclerView ViewTypes the reference docs for getItemViewType should be https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.Adapter#getitemviewtype
instead of http://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#getItemViewType
as the support library is deprecated as highlighted by @android77 here

Page 400, Title of the listing 20.10 (printing version):

(SoundViewModelTest.java) -> (SoundViewModelTest.kt)

Thanks.

Page 400, Title of the listing 20.10 (printing version):

(SoundViewModelTest.java) → (SoundViewModelTest.kt)

Thanks.

This looks like it applies to Listing 20.7

On the middle of page 419 (printing version),

Your first goal is to change the background color of BeatBox by altering the theme. While you could
navigate to res/layout/fragment_beat_box.xml and manually set the android:background attribute
on your RecyclerView – and then repeat the process in every other fragment and activity layout file
that might exist – this would be wasteful. Wasteful of your time, obviously, but also wasteful of app
effort.

fragment_beat_box → activity_main

Thanks.