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
I know this is old, but keep in mind that by simply using .isEmpty() will allow you to only add a space and the button will enable itself.
Use s1.trim().isEmpty || s2.trim().isEmpty() instead.
Or, you can do:
String s1 = editText1.getText().toString().trim()
String s2 = editText2.getText().toString().trim()
then just check for .isEmpty().
I don't know, it's however you'd want to do it, and this answer is most likely irrelevant anyway but I'd thought I'd just point that out.