2016-01-23 84 views

回答

2

是,使用addTextChangedListener()添加TextWatcher

editText.addTextChangedListener(new TextWatcher() { 
     @Override 
     public void onTextChanged(CharSequence s, int start, int before, int count) { 
      yourString = s.toString(); 
     } 

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

     @Override 
     public void afterTextChanged(Editable s) { } 
    }); 
+0

謝謝!我很抱歉沒有足夠的積分來「回答」你的答案 – romarcis

相關問題