I have two text fields and a Button. I want to disable the Button unless both EditText-Fields are not empty. I tried many solutions here at stackoverflow, but they don\'t wo
You method checkFieldsForEmptyValues
is too complicated for what your doing, try just by doing :
private void checkFieldsForEmptyValues(){
Button b = (Button) findViewById(R.id.btnRegister);
String s1 = editText1.getText().toString();
String s2 = editText2.getText().toString();
if (s1.length() > 0 && s2.length() > 0) {
b.setEnabled(true);
} else {
b.setEnabled(false);
}
}