AndroidViewModel with SavedState
问题 I need to use an AndroidViewModel with application context and a SavedStateHandle . I have it already working with application context, but I fail adding a SavedStateHandle to it. This is what I have, with only the application context: // A1. get ViewModel in Fragment val viewModel = ViewModelProvider(viewLifecycleOwner).get(MyViewModel::class.java) // A2. MyViewModel derives from my custom BaseAndroidViewModel class MyViewModel(application: Application) :BaseAndroidViewModel(application) //