Pass the webview as argument to your simulateDoubleTapEvent() method and use it for dispatching.
private void simulateDoubleTapEvent(WebView view, int action)
{
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis() + 100;
float x = 35.407104f;
float y = 378.52066f;
// List of meta states found here: developer.android.com/reference/android/view/KeyEvent.html#getMetaState()
int metaState = 0;
MotionEvent me = MotionEvent.obtain(
downTime,
eventTime,
action,
x,
y,
metaState
);
view.dispatchTouchEvent(me);
}