Fragment Observing ViewModel Property fails on reentering the Activity
I have an activity with a fragment that observes the Activity's viewmodel. Everything works fine the first time.
When the activity is destroyed, if the user comes back to the Activity, when the activity posts a value to the viewmodel, the fragment observer is never notified. Again, it works the first time and as long as I never destroy the Activity.
What am I doing wrong?
ACTIVITY
private lateinit var viewModel: TowPayViewModel
override fun onCreate(savedInstanceState: Bundle?) {...