Android : Can I use a service to handle multi-touch events?

on Thursday, September 4, 2014


I wanna write a multi-touch in a service 。How can I chance single touch to multi touch in this service?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.
}


}


0 comments:

Post a Comment