2012-07-17 25 views
1

我按下退格鍵後,我的textwatcher工作,然後這個建議來了。 我有一個textwatcher,可以從網上生成書籍列表。我也等着看它是否是一個淨問題。但我發現它不是因爲,當我按空格鍵就開始工作smoothly.Please幫助TextWatcher工作遲到

textWatcher = new TextWatcher() 
    { 
     public void afterTextChanged(Editable s) 
     { 
      chars = s; 
      currentSearch = s; 
      startSuggestionsThread(s); 
     } 

     public void beforeTextChanged(CharSequence s, int start, int count, int after) { 
     } 

     public void onTextChanged(CharSequence s, int start, int before, int count){ 
     } 
    }; 

我startsuggestionsthread我做textview.setAdapter(適配器)。但其花費很多時間

+1

粘貼您的代碼 – waqaslam 2012-07-17 12:54:50

+0

textview instanceOf ListView? – DroidBender 2012-07-18 06:36:31

+0

沒有它只是一個正常的自動完成文本視圖 – Sidk 2012-07-18 10:04:23

回答

1

也許你正在使用你的邏輯afterTextChanged方法TextWatcher。將代碼移動到beforeTextChanged以便在文本更改前運行您的代碼EditText

+0

你是透視嗎? ;-) – hsz 2012-07-17 13:00:00

+0

哈哈,不過只是一個猜測:) – waqaslam 2012-07-17 13:02:51

+0

我將代碼轉移到aftertextchanged,它的工作。它的工作太慢了。 – Sidk 2012-07-18 06:13:33