第二个 Android 11 开发者预览版现已推出,快来测试并分享您的反馈吧

HasDefaultViewModelProviderFactory

public interface HasDefaultViewModelProviderFactory

androidx.lifecycle.HasDefaultViewModelProviderFactory


Interface that marks a ViewModelStoreOwner as having a default ViewModelProvider.Factory for use with ViewModelProvider.ViewModelProvider(ViewModelStoreOwner).

Summary

Public methods

abstract ViewModelProvider.Factory getDefaultViewModelProviderFactory()

Returns the default ViewModelProvider.Factory that should be used when no custom Factory is provided to the ViewModelProvider constructors.

Public methods

getDefaultViewModelProviderFactory

public abstract ViewModelProvider.Factory getDefaultViewModelProviderFactory ()

Returns the default ViewModelProvider.Factory that should be used when no custom Factory is provided to the ViewModelProvider constructors.

Returns
ViewModelProvider.Factory a ViewModelProvider.Factory