Disabling Android Keyboard

I have several EditText objects in the application that I'm working on, and you need to learn how to remove the keyboard when the user enters text, so that the buttons locked by the keyboard on the screen are visible again and ready for action.

In Xcode, I used the ResignFirstResponder method to do this when, for example, the user clicked the Finish button on the keyboard. I assume this is possible in Android as well, but I'm not sure. I appreciate any help!

+6
source share
1 answer

Code to hide the virtual keyboard:

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0); 

Put it in the onClick () of your "Finish" button, and you will have reason to believe that Android is as powerful as Xcode (if not more).

+9
source

All Articles