Use a variable to lock the call of getXY()
Declare a new variable
Boolean callGetXY = true;
Set it to false on ACTION_DOWN and back to true on ACTION_UP
View.OnTouchListener flTouch = new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// your current content of the method here
// ...
if (event.getAction() == MotionEvent.ACTION_DOWN) {
callGetXY = false;
}
if (event.getAction() == MotionEvent.ACTION_UP) {
callGetXY = true;
}
}
};
Change line 82 to:
if (callGetXY) {
getXY()
}