code: private void requestInputMode() {
          if (needInputMethod()) {
              Window window = dialog.getWindow();
  
              if (window != null) {
                  window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
              }
          }
      }
docs: Requests the soft input method to be shown.