I have a view, that processes all MotionEvents. Processing an event can take some time (updating screen, sometimes few seconds).
If my view got another MotionEvent while processing current, it will queue it somehow, and after proceesing ends it will process the new one. I want do drop all events received during processing.
@Override
public boolean onTouchEvent (MotionEvent event)
{
// Some new_event occur
...
// Some long action
...
return true;
}
After this onTouchEvent I’ll got onTouchEvent (MotionEvent new_event).
Is there any way to discard all queued events in the end of onTouchEvent?
Well, at the moment I think that can’t be done in a single thread, so we need one thread (main) to handle events and other threads to perform event actions.