-
-
Notifications
You must be signed in to change notification settings - Fork 754
Closed
Labels
Milestone
Description
Describe the bug
In Android, if system kills the application process or activity, previous state can be restored back when user returns to the application with the help of SavedStateHandle. SavedStateHandle is correctly injected by Koin in such cases for activityViewModel()
etc. However, the injected SavedStateHandle is empty for navigation graph scoped view models. (e.g., koinNavGraphViewModel()
)
To Reproduce
Steps to reproduce the behavior:
- Enable Don't Keep Activities under Developer Options
- Run the sample app
- Click set state and then click go to second
- Press home, then return to app
- State should've been restored but lost
Expected behavior
When user returns back to app in the 5th step above, previous state should be restored from SavedStateHandle.
Koin module and version:
koin-core:3.5.6
Snippet or Sample project to help reproduce
KoinSavedStateHandleReproducer.zip