Hide keyboard when user taps anywhere else on the screen
Add code in your Activity.
This would work for Fragment also, no need to add this code in Fragment.
Register a callback for keyboard open and close
The idea is to measure a layout before and after each change and if there is a significant change you can be somewhat certain that its the softkeyboard.
then in our
onCreate set the initial value for
and add the listener
don't forget to remove the listener on
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0