我想使用辅助功能在屏幕上执行滑动。我试过了,但这只能执行一次操作。我知道这是可能的,因为在设备上启用我的服务时,它说该服务可以执行划动,触摸,捏等操作。
Point position=new Point(100,10);
GestureDescription.Builder builder = new GestureDescription.Builder();
Path p = new Path();
p.moveTo(position.x, position.y);
builder.addStroke(new GestureDescription.StrokeDescription(p, 100L, 50L));
GestureDescription gesture = builder.build();
boolean isDispatched = dispatchGesture(gesture,gestureResultCallback,null);
Run Code Online (Sandbox Code Playgroud)