检测触摸模式并将其与信息关联



我想制作一个android应用程序,检测触摸模式并将其与信息关联EG:3个具有特定距离的触摸点有什么办法做到这一点吗?

您可以使用此处记录的MotionEvent对象。查看谷歌提供的关于如何检测多次触摸的培训

更具体地说:

// The coordinates of the current screen contact, relative to 
// the responding View or Activity.  
xPos = (int)MotionEventCompat.getX(event, index);
yPos = (int)MotionEventCompat.getY(event, index);

最新更新