Heim > Fragen und Antworten > Hauptteil
阿神2017-04-17 17:30:28
edit_en.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (edit_en.isFocused()) {
edit_zh.setHint("0");
edit_en.setHint("请输入金额");
edit_zh.setText(dollar2RMB(s.toString())+"");
Log.d("aa", "edit_en::" + s.toString());
}
}
@Override
public void afterTextChanged(Editable s) {
}
});
edit_zh.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (edit_zh.isFocused()) {
edit_zh.setHint("请输入金额");
edit_en.setHint("0");
edit_en.setText(rmb2Dollar(s.toString()) + "");
Log.d("aa", "edit_zh::" + s.toString());
}
}
@Override
public void afterTextChanged(Editable s) {
}
});