et_register_email = (EditText) findViewById(R.id.et_register_email);
btn_register_email = (Button) findViewById(R.id.btn_register_email);
email = et_register_email.getText().toString().trim();
et_register_email.addTextChangedListener(new TextWatcher(){
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if (count != 0){
btn_register_email.setEnabled(false);
}else{
btn_register_email.setEnabled(true);
}
}
@Override
public void afterTextChanged(Editable s) {
}
});
btn_register_email.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(RegisterEmailActivity.this,RegisterPasswordActivity.class);
startActivity(intent);
finish();
}
});
------解决思路----------------------
都不可以用了,点击事件也就不会响应了,你可以看下SDK源码
------解决思路----------------------
你的判断写反了
而且最好把判断EditText是否有内容写在afterTextChanged中