加入Edit.addTextChangedListener(Listener),监听里有文字变化时可以做相应的处理.
//实时监听EditText内容变化
editText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
// TODO Auto-generated method stub
}
@Override
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
int arg3) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable arg0) {
// TODO Auto-generated method stub
//改变TextView内容
textView.setText(arg0.toString());
}
});