Utiliza esto
public TextWatcher amount(final EditText editText) {
return new TextWatcher() {
DecimalFormat dec = new DecimalFormat("0.00");
@Override
public void afterTextChanged(Editable arg0) {
}
@Override
public void beforeTextChanged(CharSequence s, int start,
int count, int after) {
}
private String current = "";
@Override
public void onTextChanged(CharSequence s, int start,
int before, int count) {
if(!s.toString().equals(current) && s.toString().compareTo("")!=0){
editText.removeTextChangedListener(this);
String cleanString = s.toString().replaceAll("["+getResources().getString(R.string.MonedaMonto)+",.]", "").replace(" ","");
double parsed = Double.parseDouble(cleanString.replaceAll("\\s","").trim());
// Obtienes la instancia del formateador
DecimalFormat decimalFormat = (DecimalFormat)NumberFormat.getCurrencyInstance(Locale.US);
// obtener la instancia del formatiador de simbolos
DecimalFormatSymbols symbols = decimalFormat.getDecimalFormatSymbols();
// cambias el simbolo por US
symbols.setCurrencySymbol(getResources().getString(R.string.MonedaMonto)+" ");
// le asignamos el nuevo formateador de simbolo
decimalFormat.setDecimalFormatSymbols(symbols);
// formateamos
String formatted = decimalFormat.format((parsed/100));
current = formatted;
editText.setText(formatted);
editText.setSelection(formatted.length());
editText.addTextChangedListener(this);
}
}
};
}
Para Agregarlo a tu caja
final EditText txtBillingMount = findViewById(R.id.txtBillingMount);
txtBillingMount.addTextChangedListener(this.amount(txtBillingMount));
El recurso de Moneda es
<string name="MonedaMonto">$</string>