Preventing rapid clicks with RXJava
问题 I am writing an android app and using rxjava to handle user input events. Basically what I want to do is, emit when a button is clicked, and then drop subsequent emissions for some period of time afterwards (like a second or two), essentially to prevent having to process multiple clicks of the button. 回答1: I think throttleFirst is what you want: https://github.com/Netflix/RxJava/wiki/Filtering-Observables#wiki-throttlefirst 回答2: For preventing fast clicks i use this code RxView.clicks(your