I have a single activity app and have the next problem. One of my screens (let's call it fragment A) has small viewpager (about half of the fragments' A size) with 2 fragments: B and C. The content of fragment B and C depends on content of A because it's dynamic. Fragment A has viewModel which has some id which I need to use in Fragment B. So I want to use sharedviewmodel to get this value as below: Fragment A:
viewModel.loadData()
Fragment B:
viewModel.observesomedata.observe(...)
So the problem is when initializing SharedViewModel in Fragment B, compiler says that "lazy value not initialized yet" Any suggestions?