id: String, val service: SimpleService) : ViewModel() // use injection parameter to get state viewModel { (handle: SavedStateHandle, id: String) -> StateViewModel(handle, id, get()) } // Provide initial state as parameter class MVVMActivity : AppCompatActivity() { val mySavedVM: StateViewModel by viewModel { parametersOf(Bundle()) } }