# compose

Can Korkmaz

07/13/2022, 11:53 AM
Do the lifecycle events of the composable always follow the lifecycle of the host fragment (converting Android view appliaction to compose view)? Is LocalLifeCycleOwner.current.lifecycle.Event always the same as fragment lifecycle event? If so, assuming I have code to be executed inside fragment lifecycle callbacks, say inside On_create calling viewmodel.init(), can I call it directly inside LaunchedEffect(true) or with lifeCycleObserver, when the lifecycle.Event is ON_CREATE ON_RESUME. Sorry for the least chaotic paraghraph ever.
If the viewmodel.init() is called inside the fragment lifecycle event ON_RESUME, for the same functionality, should I call this directly inside LaunchedEffect, or make a LifeCycleObserver to put inside DisposableEffect and only call in Lifecycle.event.on_resume? I think it wouldn't make much difference and I can just init it with LaunchedEffect(true){viewmodel.init()}