问题
I want to write a multi-touch functionality in a service.How can I change single-touch to multi-touch in this servic?
I found in this case e.getPointerCount() always == 1. Any idea?
Thanks at first!
public void onCreate(){
super.onCreate();
startForeground(1, new Notification());
mViewService = ViewService.getInstance(this);
mViewService.addView(ViewService.TOUCH_VIEW);
mViewService.getView(ViewService.TOUCH_VIEW).setOnTouchListener(new TouchListener());
}
class TouchListener implements View.OnTouchListener{
@Override
public boolean onTouch(View v, MotionEvent e){
int pointerCount=e.getPointerCount();
//question: why pointerCount always == 1?I wanna >=3.
//how can I chance to multi-touch.
}
}
来源:https://stackoverflow.com/questions/25661708/can-i-use-a-service-to-handle-multi-touch-events