I am learning how to write applications for android and have a question. What is the difference between using a TextWatcher and within the the onTextChanged Method, setting a string value equal to the CharSequence argument and simply using getText method.
private TextWatcher passwordListener = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
try{
password = charSequence.toString();
}
catch(Exception e){
password=null;
}
}
vs
password = password_EditText.getText().toString();