我一直在使用MotionEvent.obtain方法在应用程序上以编程方式使用点击事件
在更新操作系统后,它无法正常运行,之前运行良好。在纵向模式下可以正常工作,但在横向模式下可以单击随机位置。
示例代码:-
dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, x, y, 0));
dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, x, y, 0));