ViewModelProvider.AndroidViewModelFactory.Companion

object ViewModelProvider.AndroidViewModelFactory.Companion


Summary

Public fields

final @NonNull CreationExtras.Key<@NonNull Application>

A CreationExtras.Key to query an application in which ViewModel is being created.

Public methods

final @NonNull ViewModelProvider.AndroidViewModelFactory
getInstance(Application application)

Retrieve a singleton instance of AndroidViewModelFactory.

Public fields

APPLICATION_KEY

public final @NonNull CreationExtras.Key<@NonNull ApplicationAPPLICATION_KEY

A CreationExtras.Key to query an application in which ViewModel is being created.

Public methods

getInstance

public final @NonNull ViewModelProvider.AndroidViewModelFactory getInstance(Application application)

Retrieve a singleton instance of AndroidViewModelFactory.

Parameters
Application application

an application to pass in AndroidViewModel