Android Studio 4.0 Tutorial - Part 6

Опубликовано: 08 Август 2020
на канале: 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  


Смотрите видео Android Studio 4.0 Tutorial - Part 6 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь DJ Malone 08 Август 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,072 раз и оно понравилось 51 людям.