package com.xuan.moveforever.app_move.HTTP_RX_test.okHttpTest; import android.util.Log; import rx.Subscriber; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; /** * Created by xuanweijian on 2016/2/18. */ public class OKPresenter { IOKView mView; private OKModel model; public OKPresenter(IOKView view){ this.mView = view; model = new OKModel(); } public void okGet(){ model.okGet().subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(subscriber); } public void okGet2(){ model.okGet2().subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(subscriber2); } public void okPost(){ model.okPost().subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(subscriber3); } public void okReset(){ okGet2(); } //利用Rx 放回的处理数据 Subscribersubscriber = new Subscriber() { @Override public void onCompleted() { Log.i("RX", "onCompleted"); } @Override public void onError(Thro