Recycliewiew selection of one item. No multitouch
It drives me crazy. Something that is implemented by default in the ListView is missing from the RecyclerView.
I want to have the exact behavior of a listbox set to single selection mode. I tried the solution from this question, but it doesn't completely solve the problem. When I touch the list with 2-3 fingers, etc. It can only highlight one line, but if I raise my hands quickly, everything will start even if only one line is highlighted each time. (I can also hear the sound effect from my phone repeating 3 times very quickly)
Basically, I want to disable multi-touch events from the phone so that the list is forced to select only one item each time, no matter how many fingers the user is using
source to share
The problem is that I start a new thread every time the user clicks on the row, so if I try to click the recycler items multiple times, even in your sample app, multiple threads are started and unexpected results appear.
It has nothing to do with multitouch. You will get the same effect with one finger by quickly tapping different lines. You may find it easier to reproduce the effect with multi-touch, but there is no guarantee that the user will never hit the second line while the stream for your first line is still outstanding.
Your problem is related to your implementation. Or:
-
Clicking multiple lines in quick succession is fine and you need to fix "unexpected results" like serializing streams, having a single stream and
LinkedBlockingQueue
or synchronizing access to shared data, or -
Clicking multiple lines in quick succession is not great, in which case you will need to track if the thread is outstanding when the user clicks on the line and then decides what to do (discard the event queue? Work has to be done, so it gets done after the current thread is executed? something else?).
Another possibility is to completely get rid of the "fork in the flow in the list line" and require a more positive step (for example, clicking the "Done" button) before doing any work you are trying to do.
source to share