Hi all -- I'm new to this forum and Android programming and hoping someone can help.
I have an EditText field, and next to it an ImageView of a little keyboard. The goal is for users to click on that keyboard to toggle the keyboard on and off.
I think I know how to turn the keyboard on and off by using the methods below, but I first need to check if the keyboard is already displaying.
Can someone provide the code to check if keyboard is showing -- kind of like below:
imgKeyboard = (ImageView) findViewById(R.id.keyboard);
imgKeyboard.setOnClickListener(this);
onClick of ImageView{ // little keyboard image
if(keyboard is showing){
InputMethodManager keyboard = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
keyboard.hideSoftInputFromWindow(txtInput.getWindowToken(), 0);
} else {
InputMethodManager keyboard = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
keyboard.showSoftInput(txtInput, 0);
}
}


