我使用的是我在这里找到的非常标准的代码,以编程方式触发我的android WebView上的点击(例如,我想单击链接),但是它仅突出显示指定的x,y坐标上的内容。 / p>
long when = SystemClock.uptimeMillis();
float pressure = 1.0f;
int action = 0;
int source = MotionEvent.ACTION_UP;
MotionEvent event = MotionEvent.obtain(when, when + 50, action, x, y, pressure, 1.0f, 0, 1.0f, 1.0f, 0, 0);
event.setSource(source);
mWebView.dispatchTouchEvent(event);
我是Android编程的新手,所以我可能缺少明显的东西,有什么主意吗?