remove EditText Error - Android User Interface

Android examples for User Interface:EditText

Description

remove EditText Error

Demo Code


//package com.java2s;
import android.widget.EditText;

public class Main {
    public static void removeEditTextError(final EditText targetEditText,
            Long delayMills) {/*from   www.  j a  v  a  2 s .  c  om*/

        if (targetEditText == null) {
            return;
        }

        if (delayMills == null) {
            delayMills = 2000L; // default delayTime;
        }

        targetEditText.postDelayed(new Runnable() {
            @Override
            public void run() {
                targetEditText.setError(null);
            }
        }, delayMills);
    }
}

Related Tutorials