Package 

Class FragmentViewModelContext


  • 
    public final class FragmentViewModelContext
    extends ViewModelContext
                        

    The ViewModelContext for a ViewModel created with a fragment scope (val viewModel by fragmentViewModel<MyViewModel>).

    The owner and savedStateRegistry default to the Fragment as the provider, if you need to use an alternative source for the ViewModelStoreOwner and/or SavedStateRegistry; such in the case of JetPack Navigation Component destinations with ViewModels, then you can provided them via this context.