Android Studio 4.0 Tutorial - Part 6

Published: 08 August 2020
on channel: DJ Malone
3,072
51

Today let's pass a productCode from our main RecyclerView Adapter to our ProductInfo Fragment which allows us to lookup all data for a given product.

First we'll switch our Navigation Components to use a productCode instead of a ProductName, extract a "data" class, then use Kotlin's find{} function to fetch the product, defaulting to null if it doesn't exist.

It's a best practice to pass a unique identifier instead of a product name. Sort of like single source of truth. Questions in the comments 🙂

View code here: https://github.com/danielmalone/Andro...

Connect with me on Twitter!   / danielmalone  


Watch video Android Studio 4.0 Tutorial - Part 6 online without registration, duration hours minute second in high quality. This video was added by user DJ Malone 08 August 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,072 once and liked it 51 people.