I Had try
mTextInputLayout.seterror(null);
mTextInputLayout.setErrorEnabled(false);
how to set error or remove after correction set boarder as default in TextInputLayout Android Application
I Had try
mTextInputLayout.seterror(null);
mTextInputLayout.setErrorEnabled(false);
how to set error or remove after correction set boarder as default in TextInputLayout Android Application
To set error in TextInputLayout
, you have to give that
for example,
<LinearLayout
android:id="@+id/login_userbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputLayout
android:id="@+id/username_text_input_layout"
style="@style/TextLabel"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/etUsername"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
check this SO answer
If your trying to validate a EditText field, try adding a TextWatcher to your EditText field.
For Example
mText.addTextChangedListener(new TextWatcher(){
public void afterTextChanged(Editable edt){
if( mText.getText().length() > 7){
mText.setError("The input should be grater than 7 characters long");
}else{
mText.setError(null);
}
}
}
As per Android Developer documentation, setError(null) should work to clear errors. For more information Click Here.