Skip to content

Instantly share code, notes, and snippets.

@MohammadSamandari
Created April 1, 2019 09:20
Show Gist options
  • Save MohammadSamandari/2f5d5d372ce48ab979da8fb29bade9cc to your computer and use it in GitHub Desktop.
Save MohammadSamandari/2f5d5d372ce48ab979da8fb29bade9cc to your computer and use it in GitHub Desktop.
Learning: Hiding Keyboard After a button is clicked
// To Close The Keyboard as soon as button is clicked.
InputMethodManager mgr= (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(edtCity.getWindowToken(),0);
// edtCity is the EditText that has the focus and keyboard is writing in it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment