how to check the text of edittext
is email address or not without using javascript
and regular expression?
Here I used inputtype="textEmailAddress"
this is working but no error message is display.
On Android 2.2+ use this:
boolean isEmailValid(CharSequence email) {
return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();
}
for example:
EditText emailid = (EditText) loginView.findViewById(R.id.login_email);
String getEmailId = emailid.getText().toString();
// Check if email id is valid or not
if (!isEmailValid(getEmailId)){
new CustomToast().Show_Toast(getActivity(), loginView,
"Your Email Id is Invalid.");
}