如何在Android上打开键盘按钮?
我想要的是这样:
答案 0 :(得分:25)
请试试这个
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
答案 1 :(得分:7)
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(view, flags)
一个例子可能是:
InputMethodManager imm = (InputMethodManager) RouteMapActivity.this
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(mapView, InputMethodManager.SHOW_IMPLICIT);
答案 2 :(得分:2)
将此代码写入Button click事件中以拨打键盘:
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);