Dagger AndroidInjector cannot be provided without an @Provides-annotated method

前端 未结 1 643
悲哀的现实
悲哀的现实 2021-01-29 05:24

I\'ve done my Android projects MainActivity by means of the MVP pattern. So in my MainPresenter I want to inject a dynamic String, which then shall populate a TextView for insta

1条回答
  •  时光说笑
    2021-01-29 06:10

    You're providing a DynamicString while expecting a regular String in the constructor. You should use DynamicString there as well:

    class MyMainPresenter @Inject constructor(
        @StringForTextView dynamicString: DynamicString
    )
    

    Also, you might want to hols on to that injected value by making it a property with val.

    0 讨论(0)
提交回复
热议问题