GetHistorySize () returns 0 even in MotionEvent.ACTION_MOVE events

I kept getting 0 from event.getHistorySize (), even if the event was MotionEvent.ACTION_MOVE.

However, it is not always zero. He adds one point to 10 ACTION_MOVE events. Can anybody help?

+6
source share
2 answers

I'm not sure about this, but the same problem bothered me. I believe the MotionEvent story contains events that were not reported separately in onTouchEvent. This is also supported by the Android documentation ( http://developer.android.com/reference/android/view/MotionEvent.html ) in the "Batching" section.

+3
source

The HistorySize is a list of missing MotionEvents. Therefore, when he drops frames. This will give you all the ones that he missed, if that matters. He does not save all the events that he gave you earlier. It saves only those events that it does not.

0
source

Source: https://habr.com/ru/post/895474/


All Articles