2017-02-28 451 views

回答

1

下面的走了进去,

onAccessibilityEvent(AccessibilityEvent event){} 

然后,

//Get the source 
AccessibilityNodeInfo source = event.getSource(); 

//Grab the parent of the view that fired the event. 
AccessibilityNodeInfo rowNode = getListItemNodeInfo(source); 

//Using this parent, get references to child node, the selected text 
AccessibilityNodeInfo textNode = rowNode.getChild(0); 

//Get the text values 
String text = textNode.getText(); 

OR

或者在你的情况下,以下应该工作得很好。因为它是一个“typeViewTextSelectionChanged”事件,显然它来自EditText。

String text=event.getText(); 

欲了解更多信息,看看herehere

+0

我似乎无法找到任何getListItemNodeInfo文件,请您链接到你见过? – Jayce

相关问题