android 输入法的使用
16lz
2021-01-23
@Overrideprotected 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);}/** * * * * * 输入法的使用 */@Overridepublic 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);}}
更多相关文章
- Android 修改默认输入法
- Android 中文api (81)――InputMethod [输入法]
- Android EditText按下输入法软件的enter按键,实现跳到下一个EditT
- android 隐藏输入法
- Android关闭输入法
- android EditText和输入法相关知识总结
- TabHost随着输入法软键盘出现而上浮的问题
- android默认输入法设置
- Android定制出厂默认输入法(其他设置类似)