当前位置 : 主页 > 编程语言 > c++ >

Rxjava仿真定时器

来源:互联网 收集:自由互联 发布时间:2021-07-03
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
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;
                        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)); } });
    
   
  
 
网友评论