I have tested many ways to give the numeric and password constraint in the TextField. But its not working, See the below code.
textField.setConstraint(TextField.NUMERIC | TextField.PASSWORD);
textField.setInputModeOrder(new String[]{"123"});
Above code should work on the non touch mobiles. But its not working on the touch mobiles. So i have set the input mode value for VKB
and bind that TextField
with VKB
, see this code.
TextField txt = new TextField();
txt.setConstraint(TextField.NUMERIC |TextField.PASSWORD);
txt.setInputModeOrder(new String[]{"123"});
VirtualKeyboard vkb = new VirtualKeyboard();
vkb.setInputModeOrder(new String[]{VirtualKeyboard.NUMBERS_MODE});
VirtualKeyboard.bindVirtualKeyboard(txt, vkb);
VirtualKeyboard.NUMBERS_MODE
not working when I use above code. VKB
showing as usual format. That means AlphaNumeric
format. Why its showing like this?