When I jump to a new path, the viewmodel instance of the previous path does not seem to be recycled because onCleared is not called.
i
Ian Lake
02/12/2022, 3:38 PM
ViewModels are cleared when that destination is popped off the back stack, so it is expected that the state continues to be saved while the previous destination is still on the back stack
Note that the arguments for a destination are already available to a ViewModel if your ViewModel takes a
SavedStateHandle
parameter; there's no reason to manually pass them to a ViewModel