0

Edit: I know how to hide virtual keyboard on a MainScreen (when working with SpinboxField), but I can't hide it when working with a subclass of Screen.

3

2 Answers 2

4

You can use getScreen().getVirtualKeyboard().setVisibility(VirtualKeyboard.HIDE) -- with appropriate null checks after getScreen and getVirtualKeyboard, of course.

Note that this is only possible if you're targeting 4.7 or later -- if you want to support older platforms, you'll need a separate build without this code.

2

you can use too

getVirtualKeyboard().setVisibility(VirtualKeyboard.HIDE_FORCE);

HIDE_FORCE indicates the keyboard should always be hidden when the context has focus, and that displaying the keyboard should not be permitted.

getVirtualKeyboard().setVisibility(VirtualKeyboard.HIDE) 

HIDE indicates the keyboard should be hidden either the next time the context has focus, or immediately if the context is already has focus. Subsequently, the visibility state should be automatically saved and restored.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.