aipok
05/28/2020, 1:58 PMviewLifecycleOwner.lifecycleScope.launch
If I’m trying to update live data in my VM from .value
other fragments with same VM do not get it from observer. I have to use postValue
and in that case it delivered properly. Does anyone know why could it be? Previously I have been using uiScope
uiScope = CoroutineScope(Dispatchers.Main + job)
to launch coroutines inside my fragments and it was working fine with .value
but after I switched to viewLifecycleOwner.lifecycleScope
it is not anymore.henrikhorbovyi
05/28/2020, 4:24 PMviewLifecycleOwner.lifecycleScope
and they can't see each other.
So you can't publish a value inside one scope and expect to receive in another from another fragmenthenrikhorbovyi
05/28/2020, 4:24 PMhenrikhorbovyi
05/28/2020, 4:24 PMSaurabh
05/29/2020, 4:43 AMaipok
05/29/2020, 5:46 AM