I have problem with member injecting interface type.
Here is example: I have interface let's call it BookActivity
interface BookActivity {}
it's simple marker interface that do nothing.
and I have two implementation:
BookNewActivity: Activity, BookActivity {
@Inject someField: SomeField;
override fonCreate(savedInstanceState:Bundle?) {
activityComponent.inject(this)
}
}
BookOldActivity: Activity, BookActivity {
@Inject someField: SomeField;
override fonCreate(savedInstanceState:Bundle?) {
activityComponent.inject(this)
}
}
interface ActivityComponent {
fun inject(BookActivity)
}
When I try to get access to someField I get NPE because dagger did not inject SomeField in my class. How can I solve this problem?