Android Guides | Samples

Android.App.UiAutomation.ExecuteAndWaitForEvent Method

Executes a command and waits for a specific accessibility event up to a given wait timeout.

Syntax

[Android.Runtime.Register("executeAndWaitForEvent", "(Ljava/lang/Runnable;Landroid/app/UiAutomation$AccessibilityEventFilter;J)Landroid/view/accessibility/AccessibilityEvent;", "")]
public AccessibilityEvent ExecuteAndWaitForEvent (IRunnable command, UiAutomation+IAccessibilityEventFilter filter, Int64 timeoutMillis)

Parameters

command
The command to execute.
filter
Filter that recognizes the expected event.
timeoutMillis
The wait timeout in milliseconds.

Exceptions

TypeReason
TimeoutExceptionIf the expected event is not received within the timeout.

Remarks

Executes a command and waits for a specific accessibility event up to a given wait timeout. To detect a sequence of events one can implement a filter that keeps track of seen events of the expected sequence and returns true after the last event of that sequence is received.

Note: It is caller's responsibility to recycle the returned event.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 18