google-developer-training / android-basics-kotlin-cupcake-app

Apache License 2.0
103 stars 163 forks source link

Android Basics: Navigation backstack #48

Closed Sajini-Sadanand closed 10 months ago

Sajini-Sadanand commented 2 years ago

https://developer.android.com/codelabs/basic-android-kotlin-training-navigation-backstack?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-4%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-navigation-backstack#4

In 2nd Step, sendOrder()?

sharedViewModel.price.value.toString() is always null

Steps to reproduce?

  1. Go to Summary Screen
  2. Click on "SEND ORDER TO ANOTHER APP"
  3. Total value is always null in the description within other apps

Versions Android Studio version: Android Studio Arctic Fox | 2020.3.1 Patch 3 API version of the emulator: 30.9.5-7820599

Additional information Transformation methods for LiveData. These methods permit functional composition and delegation of LiveData instances. The transformations are calculated lazily, and will run only when the returned LiveData is observed. Lifecycle behavior is propagated from the input source LiveData to the returned one.

sharedViewModel.price.value.toString() is always null. Since it uses Transformation method, it needs to be observed

image