setError

open fun setError(errorText: CharSequence?)

Sets an error message that will be displayed below our EditText. If the error is null, the error message will be cleared.

If the error functionality has not been enabled via setErrorEnabled(), then it will be automatically enabled if {@code error} is not empty.

Parameters

errorText

Error message to display, or null to clear

See also

#getError()


open fun setError(resId: Int)

Sets an error message that will be displayed below our EditText. If the error is null, the error message will be cleared.

If the error functionality has not been enabled via setErrorEnabled(), then it will be automatically enabled if {@code error} is not empty.

Parameters

resId

Error messageResId to display, or null to clear

See also

#getError()