I have validation for editText. If the editText field is empty it should fail validation and stop the user moving on to another Activity,
editText
Activity
Better to test empty textField using If condition for all required or special validation cases and setError to focus.
If(txtName.getText().toString().trim().equals("")) { //Your message or any other validation }