2012-05-08 3 views

답변

0

당신은 문자가 글고 필드에서 입력되거나 제거 될 때마다 호출되는 글고 치기위한 TextWatcher 등록 할 수 있습니다

EditText editText = (EditText) findViewById(R.id.edit_text_field_id); 
editText.addTextChangedListener(new TextWatcher() { 

     @Override 
     public void beforeTextChanged(CharSequence s, int start, int count, int after) { 
      // This method is called to notify you that, within s, the count characters 
      // beginning at start are about to be replaced by new text with length after. 
     } 

     @Override 
     public void onTextChanged(CharSequence s, int start, int before, int count) { 
      // This method is called to notify you that, within s, the count characters 
      // beginning at start have just replaced old text that had length before. 
     } 

     @Override 
     public void afterTextChanged(Editable s) { 
      // This method is called to notify you that, somewhere within s, the text has 
      // been changed. 
     } 
     }); 

TextWatcher에 대한 설명서를 참조하십시오를 자세한 내용은

관련 문제