【发布时间】:2015-07-26 10:49:55
【问题描述】:
我有一个仅限数字字符的 EditText,当用户输入数字和按下“。”时,我需要执行特殊操作。虚拟键盘上的字符。
numberEditText = new EditText(this);
numberEditText.setInputType(InputType.TYPE_CLASS_NUMBER);
我知道存在这个监听器:
numberEditText.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
return false;
}
});
但我不知道如何使用它来满足我的需求。
任何帮助都会被磨碎。
谢谢
【问题讨论】:
-
你试过 textChagedListener 了吗?
标签: android android-edittext android-keypad