In the process of using Rxjava, there may already be many function callbacks, so how to create a data stream based on the parameters of these function callbacks?
For example, if I need to modify onKeyDown(), how can I process a specific sequence of user input according to the different keystrokes, such as special processing when the user inputs "1, 2, 3, 4".
Or if there are other function callbacks, how to use operators such as bufferDebouncezip to process the data of these function callbacks?
You can write like this
onKeyDown is the callback of Activity. It is inconvenient to wrap it in another layer, so we use Subject, which can transmit data [anytime and anywhere], subscribe and transmit easily and write separately. For general callbacks, you can write it like this. Let me give you a feel for the callbacks positioned by Baidu
For general functions, you can do this