未经检查的调用setView(V)作为原始类型的成员

时间:2018-12-30 09:18:28

标签: java android generics interface mvp

我的IDE突出显示presenter.setView并发出警告Unchecked call to setView(V) as a member of raw type 'IBaseActivity.Presenter'
有人知道我在哪里犯错了吗?我想整天,我不知道该改善什么

public abstract class BaseMvpActivity<T extends IBaseActivity.Presenter> extends BaseActivity implements IBaseActivity.View {

    @Inject
    protected T presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        presenter.setView(this);
    }

界面:

public interface IBaseActivity {

    interface View {

    }

    interface Presenter<V>{
        void setView(V view);
    }

}

0 个答案:

没有答案