Skip to content

BrowseBufferoosViewModelFactory doesn't support multiple ViewModel subclasses #4

Open
@vlazzle

Description

@vlazzle

This is probably not a big deal right now since there's currently just one ViewModel subclass, but it's still worth noting...

Right now BrowseBufferoosViewModelFactory only supports one ViewModel subclass--BrowseBufferoosViewModel. If you define a second subclass of ViewModel, calling ViewModelProviders.of(this, viewModelFactory).get(SecondViewModel::class.java) will throw IllegalArgumentException: Unknown ViewModel class.

One way to address this is to have BrowseBufferoosViewModelFactory fetch a Provider<ViewModel> from the multibound map using modelClass as the key. Further details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions