-1

i would like to know how to get the last X and Y coordinate value of the ACTION_UP motion event, since this motion event returns the last release point as well as any intermediate points since the last down event. I would like to uniquely store the last X and Y coordinates (the last x and y before the user releases his finger)

2 Answers2

0

Use MotionEvent#getX() and MotionEvent#getY() to extract the most recent coordinates.

O.O.Balance
  • 2,930
  • 5
  • 23
  • 35
  • Using getx() and gety() in ACTION_UP not only gets the last release point but also intermediate points between the last down event as i said above, i only need the last x and y coordinates before the finger is lifted – Tony naim Mar 15 '18 at 17:22
0

Check motionEvent.getAction() == MotionEvent.ACTION_MOVE and get last coordinates before MotionEvent.ACTION_UP

shmakova
  • 6,076
  • 3
  • 28
  • 44