Back to project page Android-sample.
The source code is released under:
Apache License
If you think the Android project Android-sample listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.andreabaccega.formedittextvalidator; //from w w w . j a v a 2s . c om import android.text.TextUtils; import android.widget.EditText; /** * A simple validator that validates the field only if the field is not empty. * @author Andrea Baccega <me@andreabaccega.com> * */ public class EmptyValidator extends Validator { public EmptyValidator(String message) { super(message); } public boolean isValid(EditText et) { return ! TextUtils.isEmpty(et.getText()); } }