Android:textwatcher在单个数字输入后自动从数字到qwerty交换键盘?

时间:2012-06-06 06:56:36

标签: android

我想使用文本观察器,它应该同时使用字母数字字符和数字字符,最初我的键盘是qwerty但是当我想输入所有数值并按下数字时,我的键盘会自动切换回qwerty。为什么会这样?你能帮帮我吗?

1 个答案:

答案 0 :(得分:0)

如果您只想输入数字值,请将您的Editext inputMethod更改为

 android:inputType="phone"

并且您想要显示qwerty键盘将其更改为

android:inputType="text"

如果您面临同样的问题,则意味着您需要在手机设置中将InputMethod更改为 AndroidKeyboard

否则在* onTextChanged *方法

中添加代码
@Override
    public void onTextChanged(CharSequence s, int start, int before,
            int count) {
        editextobj.setInputType(InputType.TYPE_CLASS_TEXT);
    }