android 项目基本框架搭建 整合了mvp+retrofit+rxjava
public void loadNetData(){
showLoading(true);
requestData(mService.getPageData1(1, 20, null, 32), new OnBackListener<PageDataBean>() {
@Override
public void onNext(PageDataBean dataBean) {
hideLoading();
Toast.makeText(MainActivity.this,dataBean.toString(),Toast.LENGTH_SHORT).show();
}
@Override
public void onError(Throwable e) {
showErrorView();
}
});
}
@Override
protected void initHeader(TitleView titleView) {
titleView.showTitleView(null, "left_text", null, title,null,"right_text",null,true);
}
@Override
protected void onDestroy() {
super.onDestroy();
if( netRequestWork.list.size()>0){
for (Subscriber s :netRequestWork.list) {
s.unsubscribe();
}
}
}