您可以尝试AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
在无障碍服务中设置并监听诸如
case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED: {
AccessibilityNodeInfo nodes = getRootInActiveWindow();
String nodeText = nodes.getText();
String nodeContentText nodes.getContentDescription();
// Also you could cycle through the children repeating the same
// As an example only taking the first child, you could
// loop through or use recursion
AccessibilityNodeInfo firstNode = nodes.getChild(0)
String nodeTextFirstChild = firstNode.getText();
String nodeContentTextFirstChild = firstNode.getContentDescription();
}