我正在使用moxy作为mvp。
// moxy 实现“ com.github.moxy-community:moxy:2.0.2” 实现“ com.github.moxy-community:moxy-androidx:2.0.2”
但是在主持人为空之后,我找不到错误在哪里。
我的活动:
import com.developeruz.dolphin.R;
import com.developeruz.dolphin.moxy.presenter.MainActivityPresenter;
import com.developeruz.dolphin.moxy.view.MainActivityView;
import butterknife.ButterKnife;
import moxy.MvpAppCompatActivity;
import moxy.presenter.InjectPresenter;
public class MainActivity extends MvpAppCompatActivity implements MainActivityView {
@InjectPresenter
MainActivityPresenter mPresenter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
}
private void initView() {
ButterKnife.bind(this);
mPresenter.test();
}
}
我的主持人:
import com.developeruz.dolphin.moxy.view.MainActivityView;
import moxy.MvpPresenter;
public class MainActivityPresenter extends MvpPresenter<MainActivityView> {
private MainActivityView mView;
public MainActivityPresenter() {
super();
mView = getViewState();
}
public void test() {
}
}
我的观点
import moxy.MvpView;
import moxy.viewstate.strategy.SingleStateStrategy;
import moxy.viewstate.strategy.StateStrategyType;
@StateStrategyType(SingleStateStrategy.class)
public interface MainActivityView extends MvpView {
}