开发者_开发技巧do anyone know how i know when the keyboard is close? Thanks
To determine whether or not your keyboard his hidden (closed) or not, you can use one of the following approached which return to you an enumerated value indicating whether or not the type of keyboard you're requesting is hidden or not.
getResources().getConfiguration().hardKeyboardHidden
or
getResources().getConfiguration().keyboardHidden
The difference is that keyboardHidden
will take soft keyboards into consideration along with hard keyboards, whereas hardKeyboardHidden
will only tell you whether or not the hard keyboard is hidden.
精彩评论