I am implementing OnTouchListener
and am receiving MotionEvent objects. Some ACTION_MOVE
events reports absolute X/Y coordinates, while some reports relative coordinates.
How can I ask a MotionEvent
what kind of coordinates it currently represents?
You may want to use these for absolute coordinates (absolute, regarding the screen of the device):
The other methods, getX()
and getY()
, should return you coordinates relative to the View
that dispatched them.