I tried the following: ``` @Binds @IntoMap...
# android
k
I tried the following:
Copy code
@Binds @IntoMap @ClassKey(UserViewModel::class)
        abstract fun bindUserViewModel(vm: UserViewModel) : UserViewModel

        @Binds @IntoMap @ClassKey(UserViewModel::class)
        abstract fun bindUserViewModel(vm: UserViewModel) : ViewModel

        @Binds @IntoMap @ViewModelKey(UserViewModel::class)
        abstract fun bindUserViewModel(vm: UserViewModel) : UserViewModel

        @Binds @IntoMap @ViewModelKey(UserViewModel::class)
        abstract fun bindUserViewModel(vm: UserViewModel) : ViewModel
where
Copy code
@MustBeDocumented
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME)
@MapKey
annotation class ViewModelKey(val value: KClass<out ViewModel>)
k
kirillrakhman: You can check this article. Maybe it can help: http://frogermcs.github.io/activities-multibinding-in-dagger-2/
k
I did and I believe I'm doing the same
k
kirillrakhman: Ah. Okay. You'd need to actually provide the map in one of your modules.
k
where does this happen in the linked article?
k
Notice the mock application is providing its own implementation manually. An actual application on the other hand should register a module that provides it. So that it'll be injected in the application's onCreate