code: private void requestFocus() {
          Window window = getWindow();
  
          if (window != null) {
              window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
          }
  
          if (editText != null) {
              editText.requestFocus();
          }
      }
docs: Requests the focus and displays the keyboard.