I have a pretty simple screen with a couple of EditText widgets and a button. In the emulator, when I click on the EditText widget, a virtual keyboard comes up. However, I can't seem to get rid of it. Clicking on an empty space on the screen does not make it go away. Only clicking the virtual Return key or the hardware Back button makes it disappear.
I don't have a real Android phone handy, so is this an emulator only thing or will it be like this on the actual device. If it is, what can I do to make the virtual keyboard go away, when I click elsewhere on the form?
Click the back button. They keyboard is an activity. There's not an easy way to remove the keyboard when clicking on a random area of the screen.
AngryHacker , I woud refer you to this post how to close/hide the android soft keyboard.
Hope this helps.
I think in the emulator you can press Escape to hide the keyboard. On a real device there is a hide button on the keyboard or you can press elsewhere in the ui. That's how it works on my HTC Desire S anyway.
I lived this problem and i resolved it. This problem is about InputMethodManager.SHOW_FORCED
value in my project. When i open keypad using SHOW_FORCED
then when i try to close keypad, keypad was not closing.
For Example :
activity.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(view, InputMethodManager.SHOW_FORCED);
If you use above way to open keypad, you may try to change SHOW_FORCED
value with SHOW_IMPLICIT
value
For Example :
activity.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With