Password and conform password should be the same
I have two ed开发者_JAVA百科it text fields like password and confirm-password if both the entries are true then password string value should be passed to server, but i m not getting the correct response from the server in log-cat, I am getting negative response
what is the wrong with this code? help me to solve this.
EditText etxt_password = (EditText) findViewById(R.id.regetpwd);
EditText etxt_confirmpassword = (EditText) findViewById(R.id.regetrepwd)
password = etxt_password.getText().toString();
confirmpassword = etxt_confirmpassword.getText().toString();
if (confirmpassword != null && password != null)
{
if (password.equals(confirmpassword))
{
request.addProperty("password", password);
}
}
where request is the SOAP object through which I m passing the value to server
It looks fine to me, but I've been awake for 40 hours straight... so thats not really much to go on. the only thing I can suggest is trying to combine the two if statements (you only need to know one is not null and that the two are equal to get a valid password). the other thing to try would be to maybe check the length > 0 rather than check null? I can't recall if an empty EditText returns null or empty string when you do a getText().toString()
on it...
if ((confirmpassword != null) && password.equals(confirmpassword)) {
request.addProperty("password", password);
}
精彩评论