-
public final class HiltViewModelKt
-
-
Method Summary
Modifier and Type Method Description final static <VM extends ViewModel> VMhiltViewModel(ViewModelStoreOwner viewModelStoreOwner, Bundle defaultArguments)Returns an existing HiltViewModel -annotated ViewModel or creates a new one scoped to the current navigation graph present on the NavController back stack. -
-
Method Detail
-
hiltViewModel
@Composable() final static <VM extends ViewModel> VM hiltViewModel(ViewModelStoreOwner viewModelStoreOwner, Bundle defaultArguments)
Returns an existing HiltViewModel -annotated ViewModel or creates a new one scoped to the current navigation graph present on the NavController back stack.
If no navigation graph is currently present then the current scope will be used, usually, a fragment or an activity.
- Parameters:
defaultArguments- arguments that should be passed into SavedStateHandle of the newly created ViewModel
-
-
-
-