I need to put some ListView fill code in a stream. For a simple case, this thread should not be started twice. When I want to release a new thread, the previous one should stop, whatever that is.
EDIT 1
The scenario is as follows. I have a text filter over a ListView. In textchange, I call the populateList () method.
The problem is that the code may take longer because it uses SQL syntax LIKEfor a larger database.
Until this is done, the user cannot enter anything. Thus, while you enter “abc”, you can type “outs”, you can enter “c” only after 10 seconds.
Therefore, I mean releasing the populateList () method in Thread and letting the user quickly enter something else. The longer the text, the slower the SQL query. In the “abc” situation, if you type “a”, the code is behind and starts the request, but meanwhile, if the user pressed “b”, I want to stop the execution of the stream “a” and release a new one, now using “ab” ... and so on with c.
EDIT 2
We are looking for more answers.
source
share