Android keyboard problem

How to find out if the keyboard is open or not?

+3
source share
2 answers

It is available in class Configuration. You can get current Configurationthrough getResources().getConfiguration()from Activityor another Context.

+5
source

This 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
source

Source: https://habr.com/ru/post/1786605/


All Articles