This is a limitation on the Android platform.
MotionEvent
will sometimes return absolute X and Y coordinates relative to the view, and sometimes relative coordinates to the previous motion event.
An event sent as ACTION_DOWN
will always be absolute, all other events will vary. There is no way to ask the MotionEvent
for the current type of coordinates.
This means that in practice getX()
and getY()
are useless for many use cases, and you should base your application logic on getRawX()
and getRawY()
that is guaranteed to return absolute coordinates, relative to the device screen.