我正在尝试在 MapView 上实现 onTouchEvent 以更新地理点,但是当我触摸仅捕获 ACTION_UP 的屏幕时,它会触发 3 次。在这种情况下如何执行我的代码一次?
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView) {
int action = event.getAction();
if (action == MotionEvent.ACTION_UP) {
Log.e("Touch", Integer.toString(event.getAction()));
//All 3 fires has index 1 that concern to ACTION_UP
//Below will be AsyncTask call
}
return false;
}