问题
I am writing an custom ViewGroup where I need to use only single finger touch and wanted to remove multitouch completely. I have checked with other option android:splitMotionEvents="false"
android:windowEnableSplitTouch="false"
but both are not working.
EDIT
@Override
public boolean onTouchEvent(MotionEvent ev) {
DragHelper.processTouchEvent(ev);
return true;
}
Any suggestion !
回答1:
Try following code in your custom view.
@Override
public boolean onTouchEvent(MotionEvent event)
{
// TODO Auto-generated method stub
if(event.getPointerCount() > 1) {
System.out.println("Multitouch detected!");
return true;
}
else
{
return super.onTouchEvent(event);
}
}
来源:https://stackoverflow.com/questions/29072698/how-to-allow-single-multitouch