Thread
#compose
    Shakil Karim

    Shakil Karim

    1 year ago
    I have Multiple screens as Composable like HomeScreen, DashboardScreen, etc and all of them has it's own ViewModel e.g HomeViewModel and I'm using ViewModel as
    val viewModel: HomeViewModel = viewModel()
    in each screen, Do these ViewModels remain in memory all the time because I'm using a Single Activity? and I'm not using Navigation Component
    a

    allan.conda

    1 year ago
    it lives as long as
    AmbientViewModelStoreOwner.current
    If you’re not using navigation component, it’s probably scoped to the Activity or Fragment. You can check that value to make sure