我可以使用服务来处理多点触控事件吗?

时间:2014-09-04 09:20:19

标签: android service multi-touch

我想在服务中编写多点触控功能。如何在此服务中将单点触控更改为多点触控?

我在这种情况下发现e.getPointerCount()总是== 1.任何想法?

先谢谢!

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 个答案:

没有答案