jskubick

jskubick

Kotlin and Android Development featuring Jetpack: omitted change for bottomNav val (page 190)

I’m not sure whether I just overlooked it somewhere prior to page 190, but when I got to page 190 and added the code at the bottom of the page to create AppBarConfiguration(bottomNav.menu), I got an error because bottomNav was never defined.

After comparing my MainActivity.kt to the one from chapter 7 of the zipfile, I noticed that the zipfile changed

findViewById<BottomNavigationView>(R.id.bottom_nav).setupWithNavController(this.navController)

to

val bottomNav = findViewById<BottomNavigationView>(R.id.bottom_nav) bottomNav.setupWithNavController(this.navController)

It’s entirely possible you mentioned it earlier in the book & I just overlooked it. (Sigh… I wish publishers would bundle codes for free copies of the ebook with printed copies, or work out something with Amazon like, “buy the printed book, immediately get the Kindle version free”. Ebooks suck for actual reading, but they occasionally come in handy as super-indexes that can be brute-force searched for situations like this.)


I also noticed a minor issue with the way the penny_drop_created_by entry in strings.xml is encoded… the double quotes around the book’s title need to be backslash-escaped, or they won’t be printed:

<string name="penny_drop_created_by">The <i>Penny Drop</i> app was created by Michael Fazio for the Pragmatic Bookshelf title <a href="https://pragprog.com/titles/mfjetpack/">\"Kotlin and Android Development featuring Jetpack\"</a>.</string>

As an aside, for your own future projects, you might want to check out https://noties.io/Markwon as a convenient alternative to SpannableString. I discovered it a few months ago & totally fell in love with it :icon_cool:

Popular Prag Prog topics Top

iPaul
page 37 ANTLRInputStream input = new ANTLRInputStream(is); as of ANTLR 4 .8 should be: CharStream stream = CharStreams.fromStream(i...
New
brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
brunogirin
When installing Cards as an editable package, I get the following error: ERROR: File “setup.py” not found. Directory cannot be installe...
New
dsmith42
Hey there, I’m enjoying this book and have learned a few things alredayd. However, in Chapter 4 I believe we are meant to see the “&gt;...
New
jonmac
The allprojects block listed on page 245 produces the following error when syncing gradle: “org.gradle.api.GradleScriptException: A prob...
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
New
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New

Latest in PragProg

View all threads ❯