I'm trying to emulate touch and swipes on keyboard in my android app, I find a solution how to do it with dispatchTouchEvent(motionEvent e) like in code here, but it doesn't work for me. What is wrong with it, or maybe there is better solution?
void simulateEventDown(Activity yourActivity, long x, long y) {
MotionEvent e = MotionEvent.obtain( SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(),
MotionEvent.ACTION_DOWN,
x, y, 0);
yourActivity.dispatchTouchEvent(e);
} My app