--

It seems ok to me. The viewLifecycleOwner's coroutine scope lives between onCreateView and onDestroyView. (Whereas the lifecycle owner's scope lives between onCreate and onDestroy, but that's unrelated to this comment.)

flowWithLifecycle will start and stop observing the flow as the lifecycle goes above or below the min active state, which will always be higher than or equal to the scope's outer boundaries.

--

--

Michael Ferguson
Michael Ferguson

Written by Michael Ferguson

Android software developer. Views and opinions expressed are my own and not that of my employer.

No responses yet