How to hide the Android Soft Keyboard

0

I have a EditText View and I want to hide Android Virtual keyboard whenever the EditText View does not has focus

Answered question
0

In android you can use InputMethodManager to hide a virtual keyboard. A simple code sample is shown below.

EditText editText = (EditText) findViewById(R.id.editText);  
InputMethodManager inputMethod = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethod.hideSoftInputFromWindow(editText.getWindowToken(), 0);
You are viewing 1 out of 2 answers, click here to view all answers.