Override public void onTextChanged CharSequence int start int before i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (converterViewHolder.aEditText.isFocused()) {
try {
double aValue = Double.parseDouble(converterViewHolder.aEditText.getText().toString());
double bValue = aValue * currency.getExchangeRate();
converterViewHolder.bEditText.setText(String.format(CURRENCY_FORMAT, bValue));
} catch (NumberFormatException ignore) { /* IGNORE */ }
}
}