Пример #1
0
    public void showKeyboard(String type) {
      InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);

      if (imm != null) {
        if (type.length() > 0) {
          imm.showSoftInput(this, android.view.inputmethod.InputMethodManager.SHOW_IMPLICIT);
          imm.setInputMethod(getWindowToken(), type);
        } else {
          imm.hideSoftInputFromWindow(getWindowToken(), 0);
        }
      }
    }