Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

NewInstanceFactory

open class NewInstanceFactory : ViewModelProvider.Factory
kotlin.Any
   ↳ androidx.lifecycle.ViewModelProvider.NewInstanceFactory

Simple factory, which calls empty constructor on the give class.

Summary

Public constructors

Simple factory, which calls empty constructor on the give class.

Public methods

open T
create(@NonNull modelClass: Class<T>)

Public constructors

<init>

NewInstanceFactory()

Simple factory, which calls empty constructor on the give class.

Public methods

create

@NonNull open fun <T : ViewModel!> create(@NonNull modelClass: Class<T>): T