In which task and step of the codelab can this issue be found?
Update pickup and summary fragment to use view model
Describe the problem
when you call resetOrder in init block it gives null pointer exception because the MutableLiveData
new functions will be
fun resetOrder()
{
_quantity?.value=0
_price?.value=0.0
_flavor?.value=""
Log.d("aa",getPickupOptions()[0])
_date?.value?: getPickupOptions()[0]
}
Steps to reproduce?
Go to...
Click on...
See error...
VersionsAndroid Studio version:API version of the emulator:
Additional informationInclude screenshots if they would be useful in clarifying the problem.
URL of codelab
In which task and step of the codelab can this issue be found?
Describe the problem when you call resetOrder in init block it gives null pointer exception because the MutableLiveData
new functions will be fun resetOrder() { _quantity?.value=0 _price?.value=0.0 _flavor?.value="" Log.d("aa",getPickupOptions()[0]) _date?.value?: getPickupOptions()[0] }
Steps to reproduce?
Versions Android Studio version: API version of the emulator:
Additional information Include screenshots if they would be useful in clarifying the problem.