Back to project page android-edittext-validator.
The source code is released under:
MIT License
If you think the Android project android-edittext-validator 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; // ww w.ja v a2s . c o m import android.text.TextUtils; import android.widget.EditText; /** * A simple validator that validates the field only if the value is the same as another one. * @author Andrea Baccega <me@andreabaccega.com> * */ public class SameValueValidator extends Validator { private final EditText otherEditText; public SameValueValidator(EditText otherEditText, String errorMessage) { super(errorMessage); this.otherEditText = otherEditText; } @Override public boolean isValid(EditText editText) { return TextUtils.equals(editText.getText(), otherEditText.getText()); } }