I'm completely new to android and development too. I created a page to take the email EditText, password EditText and signup button. So here how can I link this EditText to code to verify the entered values in both EditText is valid?
Below is the code that i'm trying to use.
public void isEmailValid(View view) {
this.view = view;
EditText editText = (EditText) findViewById(R.id.editText);
if (editText.getText().toString().matches("[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+") && editText.length() > 0) {
editText.setText("valid email");
} else {
editText.setText("invalid email");
}
}
Thanks in advance.