This question already has an answer here:
- The result of subscribe is not used 5 answers
I want to do something after short delay:
public void notifyMe() {
Single
.timer(500, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.io())
.subscribe(ignore -> service.notifyMe()));
}
Now I have a warning: "The result of subscribe is not used"
.
How can I fix it?
A Single will only call once. Upon calling either method, the Single terminates and the subscription to it ends.
Link can be referred for more information.