Partager via


AccessibilityService.WindowsOnAllDisplays Property

Definition

Gets the windows on the screen of all displays.

public Android.Util.SparseArray WindowsOnAllDisplays { [Android.Runtime.Register("getWindowsOnAllDisplays", "()Landroid/util/SparseArray;", "", ApiSince=30)] get; }
[<get: Android.Runtime.Register("getWindowsOnAllDisplays", "()Landroid/util/SparseArray;", "", ApiSince=30)>]
member this.WindowsOnAllDisplays : Android.Util.SparseArray

Property Value

The windows of all displays if there are windows and the service is can retrieve them, otherwise an empty list. The key of SparseArray is display ID.

Attributes

Remarks

Gets the windows on the screen of all displays. This method returns only the windows that a sighted user can interact with, as opposed to all windows. For example, if there is a modal dialog shown and the user cannot touch anything behind it, then only the modal window will be reported (assuming it is the top one). For convenience the returned windows are ordered in a descending layer order, which is the windows that are on top are reported first. Since the user can always interact with the window that has input focus by typing, the focused window is always returned (even if covered by a modal window).

<strong>Note:</strong> In order to access the windows your service has to declare the capability to retrieve window content by setting the android.R.styleable#AccessibilityService_canRetrieveWindowContent property in its meta-data. For details refer to #SERVICE_META_DATA. Also the service has to opt-in to retrieve the interactive windows by setting the AccessibilityServiceInfo#FLAG_RETRIEVE_INTERACTIVE_WINDOWS flag.

Java documentation for android.accessibilityservice.AccessibilityService.getWindowsOnAllDisplays().

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