Actually I have A requirement, where I need to take mobile no from edit text, and as the count is equal to 10 then it must call the Intent. So I am using "addTextChangedListener".
et_mobile_no.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if(count == 10){
Toast.makeText(getApplicationContext(),
"Count is " + count, Toast.LENGTH_SHORT).show();
}
}
It is working when I am putting characters or string but when I am putting mobile no means int value it is not giving the toast. Please help me how can I get the count while entering mobile no. ????
Try using
afterTextChanged
in the TextWatcher instead.