在不同时间在一个图像视图中进行多点触控 Android Studio

multi touch in one image view at different time Android Studio

我正在尝试处理图像上的用户触摸侦听器,我想存储触摸像素的图像视图的所有 XY 坐标。作为这张图片, 塞纳里奥: 用户第一次触摸图像,我想存储 XY 坐标 然后用户第二次触摸相同的图像,我也想存储 XY 坐标 等等。mobile screen

希望对您有所帮助!

public class Coordinate {
        float x;
        float y;

        public Coordinate(float x, float y) {
            this.x = x;
            this.y = y;
        }
}

ArrayList<Coordinate> coordinates = new ArrayList<>();

yourImageView.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                //int eventAction = event.getAction();
                //switch (eventAction) {
                //    case MotionEvent.ACTION_DOWN:                            
                //        break;
                //    case MotionEvent.ACTION_UP:
                //        break;
                //    case MotionEvent.ACTION_MOVE:
                //      break;
                //}
                coordinates.add(new Coordinate(event.getX(), event.getY()));
                return false;
            }
        });