I'm new in Android programming and Java and it's very difficult to understand.
I have an editText field for the email that a user can enter. I get the input with this:
final EditText loginEmail = (EditText) findViewById(R.id.loginEmail);
No I'm checking if this field is empty or not. I'm doing this with this little if:
if (loginEmail.getText().toString().length() == 0) {
loginEmail.setError("Please enter a E-Mail Address!");
} else if () {
loginEmail.setError("Invalid E-Mail Address!");
} else {
//Do a thing if is valid...
}
After the first if
I want to check if the input is a valid email or not, but don't know how to deal with this.
I've tried it with the answer from this post: Email Address Validation in Android on EditText
but I don't know how to use this method...
Thanks for helping me!