public abstract class BaseActivity<P extends IBasePresenter> extends AppCompatActivity implements IBaseView {
private P mPresenter;
protected abstract void initLayout(@Nullable Bundle savedInstanceState);
protected abstract P setPresenter();
protected abstract void initViews();
protected abstract void initData();
@SuppressWarnings("SameParameterValue")
protected <T extends View> T $(@IdRes int viewId) {
return findViewById(viewId);
}
---------------------