输入法隐藏两种方式:
/**
* 隐藏输入法
*
* @param myActivity
*/
public static void hideInput(Activity myActivity,EditText et)
{
if(et==null)
{
((InputMethodManager) myActivity.getSystemService(Activity.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(myActivity.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
else
{
InputMethodManager inputMethodManager = (InputMethodManager) myActivity.getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(et.getWindowToken(), 0);
}
}
原文地址:http://www.cnblogs.com/chensuqian/p/3811315.html