in my app I have to disabled EditText
and changing text in EditText
programatically, problem is I want EditText
to listen for TextWatcher which I added on EditText
.
But EditText
is not listening watcher.
So can anyone please help to enable EditText
listen for TextWatcher
while it is disabled and text is populated to EditText
programatically not through KeyBoard
.
I tried the below code
txtShift.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
if (s.length()>0) {
keyPadOnOff(false);
}else {
keyPadOnOff(true);
}
}
});
thanks