Package 

Class HiltViewModelKt

    • Method Summary

      Modifier and Type Method Description
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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