您可以嘗試在輔助服務設置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();
}
我使用的,但不能讀取其他應用系統dailog。 –