2010-07-26 30 views

回答

0

我不确定是否有任何编程方式在TextView中进行选择。

但是,您可以通过调用TextView.getSelectionStart()来获得选择的开始和结束位置,如果需要,可以选择首先调用hasSelection()

2

开始和结束位置可以被检索:

int selectionStart = textView.getSelectionStart(); 
    int selectionEnd = textView.getSelectionEnd(); 

及选定的文本可能是:

String selectedText = et.getText().substring(selectionStart, selectionEnd);