Using Jetpack Compose we have only one Activity
and no Fragments
anymore - Navigation in Jetpack Compose - Fragments/ViewModels
So basically each screen is just a composable function
As I understand we can't use onStart/onPause/onResume/onStop
methods of Activity
to control some components of composable screen anymore because it basically the lifecycle for all screens and we don't have Fragments
anymore to have similar lifecycle methods for each screen anymore
For example how to implement a custom photo capture screen using Camera API in compose screen right now? Where should we start and stop a camera (control its lifecycle)? It should be done in ViewModel
(init
for to start the camera and onCleared
to stop the camera) which belongs to a composable function of a specific screen?