I would like to know that a certain Button has been clicked, so it does not pass null validation. Here is the code:
//OnClick da tela de registro
btnRegistrar = (Button)findViewById(R.id.email_registrar_button);
btnRegistrar.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
intent = new Intent(LoginActivity.this,RegistrarActivity.class);
//startNewIntent("registrar");
}
});
But before opening the activity it passes in this validation:
if ((TextUtils.isEmpty(email) || TextUtils.isEmpty(password) && (!btnRegistrar.isPressed()))) {
mEmailView.setError(getString(R.string.error_field_required));
mPasswordView.setError(getString(R.string.error_field_required));
focusView = mEmailView;
cancel = true;
This "isPressed ()" was one of the tentives. Thanks!
Edit: When clicking the button it calls this validation, I used the android studio login template
Edti2: Resolved the question, it was coding error. I can not delete the question.