2017-05-17 51 views
0

我正在构建一个android应用程序,我想从其他应用程序中触发WindowManager(系统警报)警报文本。在android中读取其他应用程序WindowManager(系统警报)警报?

假设有一些应用程序像真正的调用者,并且在每次调用结束后,此应用程序在Android的WindowManager(系统警报)中显示该特定电话号码的一些信息,并且我想读取与该电话号码有关的所有信息它使用我的应用程序显示在WindowManger(系统警报)中。

是否有任何方式读取或获取WindowManger(系统警报)警报对话框触发其他应用程序的视图子。

回答

0

您可以尝试在辅助服务设置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(); 
    }