Generic @Inject'd fields in an abstract superclass

后端 未结 2 902
花落未央
花落未央 2021-02-05 05:49

Consider a MVP-ish set of types. An abstract Presenter exists, with a View interface:

public interface View {
    //...
}

public abstract class AbstractPresente         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 06:30

    This is because of the Type arguments. Injects does not work when u have a type arguments. U need to do something like this,

    bind(new LoginPresenter(){});
    

提交回复
热议问题