create
Creates the required ViewModel for our use case.
Supports MessageComposerViewModel, MessageListViewModel, and AttachmentsPickerViewModel. MessageComposerViewModel and AttachmentsPickerViewModel will receive a SavedStateHandle sourced from extras, allowing them to survive Activity recreation. Throws IllegalArgumentException for any other class.
Parameters
The class of the ViewModel to create.
CreationExtras provided by the androidx.lifecycle.ViewModelStoreOwner.
Creates the required ViewModel for our use case.
Supports MessageComposerViewModel, MessageListViewModel, and AttachmentsPickerViewModel. Throws IllegalArgumentException for any other class.
Prefer create with CreationExtras so that MessageComposerViewModel and AttachmentsPickerViewModel can survive Activity recreation.
Parameters
The class of the ViewModel to create.