当前位置: 代码迷 >> Android >> android 输入法的运用
  详细解决方案

android 输入法的运用

热度:114   发布时间:2016-05-01 20:03:53.0
android 输入法的使用

	@Override	protected void onCreate(Bundle savedInstanceState) {		super.onCreate(savedInstanceState);		setContentView(R.layout.softkey);		buttonshow = (Button)findViewById(R.id.buttonshow);		editshow = (EditText)findViewById(R.id.editshow);				buttonshow.setOnClickListener(this);		editshow.setOnClickListener(this);	}/** *  *  *  *  * 输入法的使用 */	@Override	public void onClick(View v) {		switch (v.getId()) {		case R.id.buttonshow:		showKeyboard();		break;		case R.id.editshow:		showKeyboard();		break;		default: break; 	}	}	private void showKeyboard() {		InputMethodManager m=(InputMethodManager) (this.getBaseContext().getSystemService(INPUT_METHOD_SERVICE));		m.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);		//m.hideSoftInputFromWindow(this.getWindow().getWindowStyle().get, 0);	}}
?
  相关解决方案