Errata - static vs class, listing 19.12


Listing 19.12 includes the following line of code

... (Build.Version.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && ...

But this causes an error. A tangentially related thread on Stackoverflow suggests using Build.VERSION.SDK_INT instead of Build.Version.SDK_INT, which fixes the issue for me. I believe the code presented in the book is referring to a (nonexistent?) class Build.Version, where in fact, what we want is a static Build.VERSION.

This question probably belies the fact that I’m not 100% fluent in java, but do I have that about right? Or am I making some other mistake? Any clarification would be appreciated.


It should be a typo. Rest of the book uses Build.VERSION.SDK_INT (see e.g. Chapter 16).