I have three edit text to get values getting Email is one of them and I cant validation of specific validation of Email text so any one can suggest me how to do this...
my code is ....
String Tomaail="feedback@earthcorporation.co.in";
String Name=name.getText().toString();
String Mail=mail.getText().toString().trim();
String Phone=phone.getText().toString();
String Feedback=feedback.getText().toString();
String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
if(Name.compareTo("") == 0 || Mail.compareTo("") == 0 || Phone.compareTo("") == 0 || Feedback.compareTo("") == 0)
{
if(Name.compareTo("") == 0)
{
name.setError("Enter Name");
}
else if (Mail.matches(emailPattern) || Mail.compareTo("") == 0)
{
mail.setError("Enter valid Address");
}
else if(Phone.compareTo("") == 0)
{
phone.setError("Enter Your Phone No.");
}
else
{
feedback.setError("Enter your Feedback");
}
Toast.makeText(feedback.this,"Enter All Data",Toast.LENGTH_SHORT).show();
}
else
{