ViewModelProviders.DefaultFactory



Factory which may create AndroidViewModel and ViewModel, which have an empty constructor.

Summary

Public constructors

This function is deprecated.

Use ViewModelProvider.AndroidViewModelFactory or getInstance.

android

Inherited Constants

From androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory
const CreationExtras.Key<Application!>!

This property is deprecated. Deprecated in Java

android
const ViewModelProvider.AndroidViewModelFactory.Companion!

This property is deprecated. Deprecated in Java

android
From androidx.lifecycle.ViewModelProvider.NewInstanceFactory
const CreationExtras.Key<String!>!

This property is deprecated. Deprecated in Java

android

Inherited functions

From androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory
T!
<T : ViewModel?> create(modelClass: Class<T!>!, extras: CreationExtras!)

This function is deprecated. Deprecated in Java

android
java-static ViewModelProvider.AndroidViewModelFactory!
getInstance(application: Application!)

This function is deprecated. Deprecated in Java

android
From androidx.lifecycle.ViewModelProvider.Factory
T!
<T : ViewModel?> create(modelClass: Class<T!>!)

This function is deprecated. Deprecated in Java

android
java-static ViewModelProvider.Factory!
from(initializers: Array<ViewModelInitializer<*>!>!)

This function is deprecated. Deprecated in Java

android
From androidx.lifecycle.ViewModelProvider.NewInstanceFactory
java-static ViewModelProvider.NewInstanceFactory!

This function is deprecated. Deprecated in Java

android

Public constructors

DefaultFactory

DefaultFactory(application: Application)

Creates a AndroidViewModelFactory

Parameters
application: Application

an application to pass in AndroidViewModel