If EditText is empty then Login Button has to be disabled. And if EditText has some texts then Login Button has to be ena
hey if want to use the code cut the button needs to change color if the editText1_id and the editText1_passcode is in and in 4 digits
checkValidation();
editText1_id.addTextChangedListener(mWatcher);
editText1_passcode.addTextChangedListener(mWatcher);
}
private void checkValidation() {
// TODO Auto-generated method stub
if ((TextUtils.isEmpty(editText1_id.getText()))
|| (TextUtils.isEmpty(editText1_passcode.getText())))
loginbtn.setEnabled(false);
else
loginbtn.setEnabled(true);
}
TextWatcher mWatcher = new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
// TODO Auto-generated method stub
checkValidation();
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
};
}