Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getHistorySize() returns 0 even on MotionEvent.ACTION_MOVE events

Tags:

android

I kept getting 0 from event.getHistorySize() even when the event is MotionEvent.ACTION_MOVE.

However, it's not always zero. It adds one point count in like 10 ACTION_MOVE events. Can anyone please help?

like image 851
KKstarhawk Avatar asked Aug 20 '11 06:08

KKstarhawk


1 Answers

I am not sure about this, but I have been troubled by the same problem. What I believe is that the MotionEvent history contains the events which have not been reported individually to the onTouchEvent. This is also supported by the Android Documentation (http://developer.android.com/reference/android/view/MotionEvent.html) under "Batching".

like image 179
Inua Avatar answered Nov 05 '22 11:11

Inua