List of usage examples for android.widget TextView setError
public void setError(CharSequence error, Drawable icon)
From source file:com.androidformenhancer.helper.FormHelper.java
/** * Sets the error icon and popup window to the specified TextView or * EditText.<br>// ww w .ja v a 2 s .c o m * Before calling this, you must call {@linkplain #validate()} or * {@linkplain #validateText(int)} to get validation result. * * @param result validation result * @param textView TextView or EditText object which you want to set error */ public void setErrorToTextView(final ValidationResult result, final TextView textView) { if (mValidationErrorIconEnabled) { int id = textView.getId(); if (result.hasErrorFor(id)) { textView.setError(StringUtils.serialize(result.getErrorsFor(id)), mIconError); textView.setCompoundDrawables(null, null, mIconError, null); } else { textView.setCompoundDrawables(null, null, mIconOk, null); } } }