Instrumentation.GetUiAutomation(UiAutomationFlags) メソッド

定義

フラグが設定された UiAutomation インスタンスを取得します。

[Android.Runtime.Register("getUiAutomation", "(I)Landroid/app/UiAutomation;", "GetGetUiAutomation_IHandler", ApiSince=24)]
public virtual Android.App.UiAutomation? GetUiAutomation (Android.App.UiAutomationFlags flags);
[<Android.Runtime.Register("getUiAutomation", "(I)Landroid/app/UiAutomation;", "GetGetUiAutomation_IHandler", ApiSince=24)>]
abstract member GetUiAutomation : Android.App.UiAutomationFlags -> Android.App.UiAutomation
override this.GetUiAutomation : Android.App.UiAutomationFlags -> Android.App.UiAutomation

パラメーター

flags
UiAutomationFlags

UiAutomation に渡されるフラグ (例: UiAutomation#FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES)。 UiAutomation#FLAG_DONT_USE_ACCESSIBILITY

戻り値

UI オートメーション インスタンス。

属性

注釈

フラグが設定された UiAutomation インスタンスを取得します。

<厳密な>注:</strong> インストルメンテーションによって公開される API では、アプリケーションの境界を越えて返された UiAutomation 作業を介して公開される API は公開されません。 たとえば、 Instrumentation#sendPointerSync(MotionEvent) ではインストルメンテーション ターゲットとは異なるアプリにイベントを挿入することはできませんが UiAutomation#injectInputEvent(android.view.InputEvent, boolean) 、現在のアプリケーションに関係なく機能します。

一般的なテスト ケースでは、 または Instrumentation API を使用UiAutomationする必要があります。 両方の API を同時に使用することは間違いではありませんが、クライアントは API の制限に注意する必要があります。

UiAutomationが異なるフラグを持つ が存在する場合は、そのインスタンスのフラグが変更され、そのフラグが返されます。

互換モード: このメソッドは、以前のバージョンを対象とする Build.VERSION_CODES#R アプリでは無効です。新しいバージョンを対象とするアプリの場合、接続に失敗した場合 UiAutomation は null が返されます。 呼び出し元は戻り値をチェックし、エラー時に再試行できます。

android.app.Instrumentation.getUiAutomation(int)Java ドキュメント。

このページの一部は、によって作成および共有された作業に基づく変更であり、に記載されている条件に従って使用されます。

適用対象