code: private void showErrorText(@Nullable final CharSequence errorText) {
          if (textInputLayout != null) {
              if (TextUtils.isEmpty(errorText)) {
                  textInputLayout.setError(null);
                  textInputLayout.setErrorEnabled(false);
                  adaptHelperTextColor();
              } else {
                  textInputLayout.setHelperText(null);
                  textInputLayout.setHelperTextEnabled(false);
                  textInputLayout.setError(errorText);
                  textInputLayout.setErrorEnabled(true);
              }
          }
      }
docs: Shows an error text.