Monthly Archives: November 2012

Hiding soft keyboard

This is just to show if you need to hide keyboard after you are done with inputting a edittext/autocompletetextview. Just call hideSoftKeyboard() will hide the keyboard.


private EditText searchBar;

private void hideSoftKeyboard(){
 InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
 imm.hideSoftInputFromWindow(searchBar.getWindowToken(), 0);
 }

Advertisements