RxJava timer that repeats forever, and can be restarted and stopped at anytime
问题 In android i use Timer to execute task that repeats every 5 seconds and starts after 1 second in this way: Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { // Here is the repeated task } }, /*Start after*/1000, /*Repeats every*/5000); // here i stop the timer timer.cancel(); this timer will repeat Until i call timer.cancel() I am learning RxJava with RxAndroid extension So i found this code on internet, i tried it and it doesnt repeat: