建立在上篇文章基础之上,我们只需要增加一个类似碎片的attach和detach就可以了。再增加一个interrupt来中断网络请求。
看看我们改造后的P
public class RequestPresenter { private RequestView mRequestView; private RequestModel mRequestModel; public RequestPresenter() { this.mRequestModel = new RequestModel(); } public void clickRequest(String userName, String userPassword) { if (mRequestView != null) { mRequestView.requestLoading(); mRequestModel.loginRequest(userName, userPassword, new Subscriber<JSONObje