Share via


Instrumentation.SendPointerSync(MotionEvent) Method

Definition

Dispatches a pointer event into a window owned by the instrumented application, and waits for it to be processed.

[Android.Runtime.Register("sendPointerSync", "(Landroid/view/MotionEvent;)V", "GetSendPointerSync_Landroid_view_MotionEvent_Handler")]
public virtual void SendPointerSync (Android.Views.MotionEvent? e);
[<Android.Runtime.Register("sendPointerSync", "(Landroid/view/MotionEvent;)V", "GetSendPointerSync_Landroid_view_MotionEvent_Handler")>]
abstract member SendPointerSync : Android.Views.MotionEvent -> unit
override this.SendPointerSync : Android.Views.MotionEvent -> unit

Parameters

e
MotionEvent

A motion event describing the pointer action. (As noted in M:Android.Views.MotionEvent.Obtain(System.Int64,System.Int64,System.Int64,System.Int64,System.Int64,System.Int64), be sure to use UptimeMillis() as the timebase.

Attributes

Remarks

Dispatches a pointer event into a window owned by the instrumented application, and waits for it to be processed.

If the motion event being injected is targeted at a window that is not owned by the instrumented application, the input injection will fail. See #getUiAutomation() for injecting events into all windows.

This method blocks until the recipient has finished handling the event. Note that the recipient may <em>not</em> have completely finished reacting from the event when this method returns. For example, it may still be in the process of updating its display or UI contents upon reacting to the injected event.

Java documentation for android.app.Instrumentation.sendPointerSync(android.view.MotionEvent).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to