My setup is: java Activity getting a ViewModel using Koin. All good with this, but when I rotate a phone, the ViewModel is always recreated. So how to avoid ViewModel recreation in the case? Thanks.
Activity:
private final FlowViewModel viewModel = get(FlowViewModel.class);
Koin:
val appModule = module {
...
viewModel { FlowViewModel(get()) }
}