My requirement: Reading the text from pop up, dialog etc for particular app.
I have implemented an accessibility service and I am receiving proper events and data as
you should check whether there are any sub child for child nodes.
private void clickPerform(AccessibilityNodeInfo nodeInfo)
{
if(nodeInfo != null)
{
for (int i = 0; i < nodeInfo.getChildCount(); i++) {
AccessibilityNodeInfo childNode = nodeInfo.getChild(i);
Log.e("test", "clickPerform: "+childNode );
if (childNode != null) {
for (int j = 0; j <= childNode.getChildCount(); j++) {
AccessibilityNodeInfo subChild = childNode.getChild(i);
if (String.valueOf(subChild.getText()).toLowerCase().equals("ok")) {
subChild.performAction(AccessibilityNodeInfo.ACTION_CLICK);
} else {
Log.e("t2", "clickPerform: ");
}
}
}
}
}
}