0
I can’t make a condition to apply mascara in an editText anyone help me please ?
final EditText tel = (EditText) findViewById(R.id.phone);
// Armazene seus TextWatcher para posterior uso
//telMask = Mask.insert("(##)#########", tel);
String digControle = String.valueOf(tel.getText().toString().charAt(4));
//char numero = tel.getText().toString().charAt(4);
if (digControle.equals(9)) {
telMask = Mask.insert("(##)#####-####", tel);
} else {
telMask = Mask.insert("(##)####-####", tel);
}
tel.addTextChangedListener(telMask);
What happens? what’s wrong?
– Thiago Luiz Domacoski
says app has stopped working
– Felipe Teles
Have logger? Displays some error?
– Thiago Luiz Domacoski