gistfile1.txt Observable.interval(0, 20, TimeUnit.MILLISECONDS) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .map(new Func1 () { @Override public Integer call(Long aLong) { Long y = (aLong + 1) / 20; retur
Observable.interval(0, 20, TimeUnit.MILLISECONDS) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .map(new Func1() { @Override public Integer call(Long aLong) { Long y = (aLong + 1) / 20; return y.intValue(); } }) // .delay(new Func1 >() { // @Override // public Observable call(Integer integer) { // return null; // } // }) .scan(new Func2 () { @Override public Integer call(Integer integer, Integer integer2) { return null; } }) .take(mQue + 1) .doOnSubscribe(new Action0() { @Override public void call() { setText(String.valueOf(0.0)); } }) .subscribe(new Subscriber () { int x = 20; @Override public void onStart() { super.onStart(); x = mQue; } @Override public void onCompleted() { setText(String.valueOf(num)); } @Override public void onError(Throwable e) { Logger.d("error " + e.getMessage()); } @Override public void onNext(Integer integer) { --x; Logger.d(String.valueOf(integer)); setText(String.valueOf(v * integer)); } });