Open levis501 opened 4 years ago
I found a solution, by caching the root node from received events
AccessibilityNodeInfo mLastKnownRoot; @Override public void onAccessibilityEvent(AccessibilityEvent event) { AccessibilityNodeInfo root = event.getSource(); while (root != null) { mLastKnownRoot = root; root = root.getParent(); } }
The mLastKnownRoot
can be used as the argument to findScrollableNode
when getRootInActiveWindow
is null. Also, the permission android:accessibilityEventTypes="typeAllMask"
should be added to the accessibility-service xml
Hola
Hola
I have same problem. It giving null vlaue
Following the Scroll button portion of the sample, the service crashes whenever the scroll button is pressed. The getRootInActiveWindow() call is returning null even though, according to the API, this should not happen when android:canRetrieveWindowContent="true", which it is in both the github repository and in my own working directory.