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:

First Post!

mfazio23

mfazio23

Author of Kotlin and Android Development featuring Jetpack

Jeff, don’t worry on this one, you’re correct. I forgot to include it in the text.

As far as the strings.xml update, you’re correct. I think I missed it due to the link highlighting.

Also, Markwon looks way nicer, and I’m always in favor of using Markdown syntax!

Where Next?

Popular Pragmatic Bookshelf topics Top

iPaul
page 37 ANTLRInputStream input = new ANTLRInputStream(is); as of ANTLR 4 .8 should be: CharStream stream = CharStreams.fromStream(i...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
hazardco
On page 78 the following code appears: &lt;%= link_to ‘Destroy’, product, class: ‘hover:underline’, method: :delete, data: { confirm...
New
dachristenson
I’ve got to the end of Ch. 11, and the app runs, with all tabs displaying what they should – at first. After switching around between St...
New

Other popular topics Top

ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
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
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
New

Sub Categories: