Android SetText muda o tipo de teclado
Estou desenvolvendo uma aplicação android que contém umEditText
.
Eu controlo o que está escrito no editText chamando
et.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
String message = et.getText().toString();
if(s.toString().compareTo(before)!=0){
et.setText(message);
et.setSelection(et.getText().length());
}
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
before = et.getText().toString();
System.out.println("After");
}
public void onTextChanged(CharSequence s, int start, int before, int count) {
System.out.println("ON");
}
});
Na função afterTextChanged eu usoet.setText("some Text");
o problema é que, depois que o texto é alterado, o teclado também muda, por exemplo, se osymbol
teclado foi aberto e eu usei setText, ele será alterado automaticamente paraqwerty
.
Como posso resolver este problema?