Gabriel Tomé
unread,Aug 8, 2011, 3:24:07 PM8/8/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Android Brasil - Dev
Estou tentando implementar uma máscara automática.
O método onTextChanged funciona tranquilo com outras funcionalidades.
Quando coloco pra formatar não dá certo.
Alguém pode ajudar?
Valeu
txtValor.addTextChangedListener(new TextWatcher() {
public void beforeTextChanged(CharSequence s, int start,
int count, int after) {
}
public void onTextChanged(CharSequence s, int start, int
before, int count) {
NumberFormat formatter = new
DecimalFormat("$#.###.###,##");
txtValor.setText(formatter.format(txtValor.getText()));
}
@Override
public void afterTextChanged(Editable arg0) {
}
});