getViewModelOrThrow
fun <T : ViewModel> getViewModelOrThrow(owner: ViewModelStoreOwner, kotlinClass: KClass<*>, key: String): T
Returns an existing ViewModel or throws an exception when no matching view model can be restored.
Parameters
owner
The ViewModelStoreOwner owning the store.
key
Unique identifier for this ViewModel.