Why numeric constraint didn't work on Virtual keyboard in LWUIT?

安稳与你 提交于 2019-12-02 07:19:00

This is a bug in LWUIT, thanks for bringing it to our attention I'll try to commit a fix for it in the next couple of weeks. It would be sooner but we need to fly to JavaOne soon.

If you want to try the fix locally just update this method in VirtualKeyboard.java:

public void setInputType(int inputType) {
    if((inputType & TextArea.NUMERIC) == TextArea.NUMERIC || 
            (inputType & TextArea.PHONENUMBER) == TextArea.PHONENUMBER) {
        setInputModeOrder(new String []{NUMBERS_MODE});
        return;
    }
    if((inputType & TextArea.DECIMAL) == TextArea.NUMERIC) {
        setInputModeOrder(new String []{NUMBERS_SYMBOLS_MODE});
        return;
    }
    setInputModeOrder(defaultInputModeOrder);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!