Skip to content

Instantly share code, notes, and snippets.

@brucetoo
Created August 11, 2015 08:21
Show Gist options
  • Save brucetoo/7f746a47da396286c9a1 to your computer and use it in GitHub Desktop.
Save brucetoo/7f746a47da396286c9a1 to your computer and use it in GitHub Desktop.
输入的显示和隐藏
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); //切换输入法的显示和隐藏
imm.showSoftInput(edittext, InputMethodManager.SHOW_FORCED); //强制显示输入法,edittext为输入接收的view
imm.hideSoftInputFromWindow(edittext.getWindowToken(), 0);//隐藏输入法
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment