I have a EditText
and button aligned to parent's bottom.
When I enter text in it and press the button to save data, the virtual keyboard does not disappear.
Can any one guide me how to hide the keyboard?
I have a EditText
and button aligned to parent's bottom.
When I enter text in it and press the button to save data, the virtual keyboard does not disappear.
Can any one guide me how to hide the keyboard?
Solution included in the EditText action listenner:
I use this method to remove keyboard from edit text :
And this method to remove keyboard from activity (not work in some cases - for example, when edittext, to wich is binded keyboard, lost focus, it won't work. But for other situations, it works great, and you do not have to care about element that holds the keyboard)
You can see marked answer on top. But i used
getDialog().getCurrentFocus()
and working well. I post this answer cause i cant type"this"
in my oncreatedialog.So this is my answer. If you tried marked answer and not worked , you can simply try this:
You might also want to define the imeOptions within the EditText. This way, the keyboard will go away once you press on Done:
and in xml
Just write down these two lines of code where enter option will work.