How to get double touch position in android?

前端 未结 2 1070
星月不相逢
星月不相逢 2021-01-07 07:56

I need to get the positions of each touch when a double touch has done I know that you can get the position of one touch with:

int x = (int)event.getX();
int         


        
2条回答
  •  忘掉有多难
    2021-01-07 08:06

    event.getPointerCount() will tell you how many touch points there are. To get the other ones, just use an index value in the "Get" method:

    x0 = event.getX(0);
    x1 = event.getX(1);
    ...

提交回复
热议问题