What's the correct way to unsubscribe from Single [duplicate]
问题 This question already has answers here : The result of subscribe is not used (6 answers) Closed 9 months ago . 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? 回答1: A Single will only call once. Upon calling either method, the Single terminates and the subscription to it ends. Link