|
public void jsmethod_showSleep(UZModuleContext uzModuleContext){
new TouchThread().run();
Log.e("touch","设置启动");
}
private class TouchThread extends Thread{
@Override
public void run() {
super.run();
Log.e("touch","启动子线程");
Instrumentation mInst = new Instrumentation();
mInst.sendPointerSync(MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, 100, 100, 0)); //x,y 即是事件的坐标
mInst.sendPointerSync(MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, 100, 100, 0));
}
} |
|