首页 > android 怎么显示和隐藏键盘输入法?

android 怎么显示和隐藏键盘输入法?

我的应用里面有一个EditText和Button,我想在当我点击Button的时候让输入法键盘隐藏,请问怎么弄啊?


废话不多说,直接上代码了..

InputMethodManager inputMethodManager =(InputMethodManager)activity.getApplicationContext().
			getSystemService(Context.INPUT_METHOD_SERVICE); 
		
EditText editText = (EditText)findViewById(R.id.xxxx); 
inputMethodManager.hideSoftInputFromWindow(editText.getWindowToken(), 0); //隐藏
【热门文章】
【热门文章】