?????????????????
??????????? ?????  ?????С??? ??????????????????????????????????С?????????????????????? ?????????????????? ??? ——??????
??????????????????
????????????????????????????
?????????????????????д????????????д????????????????????????????????????д??????????????£????????£????debug????????????????????????????????????????debug?????????????????????????????????????????????????????????????
?????????????Щ???????????????£???????????????д????????
????????????????
??????????е???????????Activity?????д????????????±????
?????????????????д???????????????????д????????????????????????????????????д?????????????????????????? Android ??????????д????????
??????????????????????MVP??????????д??????????????????Junitд?????????????????JVM????????????????Android?????С?
?????????????????? ????ν??????????MVP????
??????????
????д?????????棬????????????д????????????λ???????????????????????
????????????д?????????
public class CreditCardPresenter extends BasePresenter<CreditCardContract.View?? CreditCardContract.Model> implements CreditCardContract.Presenter {
//??????????
public void getCreditCards() {
getModel().getCreditCards()
.subscribe(new Subscriber<List<CreditCard>>(){
@Overridec
public void onNext(List<CreditCard> creditCards) {
getView().showCreditCards(creditCards);
}
@Override
public void onCompleted() {
getView().loadCompleted();
}
@Override
public void onError(Throwable e) {
getView().showError(e);
}
});
}
}
??????????????????????б???????????????????????????
????getView().showCreditCards(creditCards);
????getView().loadCompleted();
???????????????????????????????
????getView().showError(e);