I have 6 edittexts (will be using for OTP)
Each edittext will only allow 1 character and then transfer to another edittext
Here is the sample code:
et1.requestFocus()
et1.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start,int before, int count {
if(et1.getText().toString().length()==size){
et2.requestFocus();
}
}
public void beforeTextChanged(CharSequence s, int start,
int count, int after) {}
public void afterTextChanged(Editable s) {
et1.setTransformationMethod(new PasswordTransformationMethod());
}
});
What happens is, the et1, doesn't mask itself as dot/asterisk but the focus is transferred to et2.
But whenever I tap it again, it masks itself.
Edit: Already added inputType="numberPassword" in my XML but still not working