If EditText is empty then Login Button has to be disabled. And if EditText has some texts then Login Button has to be ena
EditText
Button
try this
if(s1.equals("") && s2.equals("")) { b.setEnabled(true); // to change color of the button you need to apply style to the button[here refer custom bg][1] } else { b.setEnabled(false); //do nothing or display toast msg }