Class ViewModelProvider.NewInstanceFactory

java.lang.Object
icyllis.modernui.lifecycle.ViewModelProvider.NewInstanceFactory
All Implemented Interfaces:
ViewModelProvider.Factory
Enclosing class:
ViewModelProvider

public static class ViewModelProvider.NewInstanceFactory extends Object implements ViewModelProvider.Factory
Simple factory, which calls empty constructor on the give class.
  • Constructor Details

    • NewInstanceFactory

      public NewInstanceFactory()
  • Method Details

    • create

      @Nonnull public <T extends ViewModel> T create(@Nonnull Class<T> modelClass)
      Description copied from interface: ViewModelProvider.Factory
      Creates a new instance of the given Class.

      Specified by:
      create in interface ViewModelProvider.Factory
      Type Parameters:
      T - The type parameter for the ViewModel.
      Parameters:
      modelClass - a Class whose instance is requested
      Returns:
      a newly created ViewModel