remove EditText Error - Android android.widget

Android examples for android.widget:EditText

Description

remove EditText Error

Demo Code

import android.widget.EditText;

public class Main{

    public static void removeEditTextError(final EditText targetEditText,
            Long delayMills) {/*from  w  w w .  j av a2  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