开发者

android keyboard open issue

How can i know if the keyboa开发者_如何学编程rd is open or not?


This is available on the Configuration class. You can get the current Configuration via getResources().getConfiguration() from your Activity or other Context.


That way =)

public boolean isKeyboardVisible(){
 // Checks whether a hardware keyboard is visible
 if (getResources().getConfiguration().hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) {
     return true;
 } else if (getResources().getConfiguration()..hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) {
     return false;
 }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜