1

In my application , I worked on registration page, the validations are working for android redme mobile but android samsung mobile its not working correctly. Why this happens? Please guide what to do?

here is my code :

mail.addTextChangedListener(new TextWatcher() {

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    // TODO Auto-generated method stub              
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count,
                    int after) {
    // TODO Auto-generated method stub                          
    }

    @Override
    public void afterTextChanged(Editable s) {
    // TODO Auto-generated method stub
        if(mail.getText().toString().matches("[a-zA-Z0-9._@]+") && s.length()==0){
                    mail.setError("it can not be empty");
        }
        if(mail.getText().toString().matches("[a-zA-Z0-9._@]+") && s.length() > 3){
            if((mail.getText().toString().matches("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
                + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"))){
                        String emaild=mail.getText().toString().trim();
                        for (int i = 0; i < mylist.size(); i++) {
                            Map<String, String> map = mylist.get(i);
                             String str1 = map.get("EMAIL");

                             if(emaild.equals(str1)){
                                 String equalmailid=mail.getText().toString().trim();
                                 ApplicationData.addequalmailid(equalmailid);
                                 mail.setError("This Email Id Alreay Exist Please Choose Another Email Id");

                             }

                        }

                    }else{
                        mail.setError("Enter Vaild Email Only");

                    }

                }else{

                    mail.setError("Enter Atleast 3 to 30 Characters with a Combination of Lowercase Letters,Numbers & Special Charecters(such as @,., and _)");
                  }

             }
        });
Skizo-ozᴉʞS ツ
  • 19,464
  • 18
  • 81
  • 148
Pushpa Latha
  • 139
  • 1
  • 1
  • 12

0 Answers0