1

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?

user924
  • 8,146
  • 7
  • 57
  • 139
  • Does this answer your question? [How are Android activities handled with Jetpack Compose and Compose Navigation?](https://stackoverflow.com/questions/68962458/how-are-android-activities-handled-with-jetpack-compose-and-compose-navigation) – Phil Dukhov Dec 18 '21 at 01:55

0 Answers0