List of usage examples for android.view.accessibility AccessibilityNodeInfo getWindow
public AccessibilityWindowInfo getWindow()
From source file:com.android.utils.AccessibilityNodeInfoUtils.java
/** * Returns the node to which the given node's window is anchored, if there is an anchor. * Note: you must recycle the node that is returned from this method. */// w w w. ja va2 s . c o m public static AccessibilityNodeInfoCompat getAnchor(@Nullable AccessibilityNodeInfoCompat node) { if (!BuildCompat.isAtLeastN()) { return null; } if (node == null) { return null; } AccessibilityNodeInfo nativeNode = (AccessibilityNodeInfo) node.getInfo(); if (nativeNode == null) { return null; } AccessibilityWindowInfo nativeWindow = nativeNode.getWindow(); if (nativeWindow == null) { return null; } AccessibilityNodeInfo nativeAnchor = nativeWindow.getAnchor(); if (nativeAnchor == null) { return null; } return new AccessibilityNodeInfoCompat(nativeAnchor); }