在长时间单击Webview之后,我需要将文本粘贴到Webview的字段中。该Web视图是从其他服务器加载的,其字段对我隐藏了。
Autoclicker单击Web视图上的任何位置,但不单击系统android上下文菜单中的“粘贴”按钮。
Thread one = new Thread() {
public void run() {
try {
Thread.sleep(20000);
long downTime = SystemClock.uptimeMillis()+100;
long eventTime = SystemClock.uptimeMillis() + 10000;
float x = 134;
float y = 260;
int metaState = 0;
MotionEvent motionEvent = MotionEvent.obtain(
downTime,
eventTime,
MotionEvent.ACTION_DOWN,
x,
y,
metaState
);
Thread.sleep(10000);
mWebView.dispatchTouchEvent(motionEvent);
} catch(InterruptedException v) {
System.out.println(v);
}
}
};
one.start();