2010-09-06 147 views

回答

2

您可以覆蓋onSelectionChanged(int selStart,int selEnd)以獲取有關選擇更改的通知。如果光標移動,這也稱爲(在這種情況下selStart == selEnd)

+0

謝謝。愚蠢的我。我一定錯過了:-( – znq 2010-09-06 17:39:49

+0

對不起,這個愚蠢的問題,但我是Android開發新手,所以你可以給我一個使用onSelectionChange的例子嗎?當我嘗試應用它時,Eclipse似乎沒有列出那個函數到EditText。它是否不適用於SDK 1.5版本? – AlexPriceAP 2011-07-22 18:35:39

+0

onSelectionChanged可用於API Level 3,即Android 1.5。它在EditText的基類TextView中是可覆蓋的,所以一定要檢查TextView的可重寫屬性Eclipse對話框。 – Thorstenvv 2011-07-25 11:59:14