Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在android中获得双击位置?_Android_Touch_Double - Fatal编程技术网

如何在android中获得双击位置?

如何在android中获得双击位置?,android,touch,double,Android,Touch,Double,我需要得到每次触摸的位置,当双触完成时 我知道您可以通过以下方式获得一触式定位: int x = (int)event.getX(); int y = (int)event.getY(); 如何获得第二个x和y?事件。getPointerCount()将告诉您有多少个接触点。 要获取其他索引,只需在“get”方法中使用索引值: x0=event.getX(0) x1=事件getX(1) …事件。getPointerCount()将告诉您有多少个触摸点。 要获取其他索引,只需在“get”方法中使

我需要得到每次触摸的位置,当双触完成时 我知道您可以通过以下方式获得一触式定位:

int x = (int)event.getX();
int y = (int)event.getY();
如何获得第二个x和y?

事件。getPointerCount()将告诉您有多少个接触点。 要获取其他索引,只需在“get”方法中使用索引值:

x0=event.getX(0)
x1=事件getX(1)

事件。getPointerCount()将告诉您有多少个触摸点。 要获取其他索引,只需在“get”方法中使用索引值:

x0=event.getX(0)
x1=事件getX(1)

…为什么不在onTouch函数中使用逻辑呢。使用静态变量并保留一个计数。如果cout变为2,则需要双击。

为什么不在onTouch函数中使用逻辑呢。使用静态变量并保持计数。如果cout变为2,则双击