This application is for Android Developers Codelabs. Click here to Start!
-
in
GameFragment
useprivate val viewModel: GameViewModel by lazy { ViewModelProvider(this)[GameViewModel::class.java] }
instead of
private val viewModel: GameViewModel by viewModels()
I noticed that viewModels()
is not definable. So, found the answer above.
Enjoy codding!๐๐๐