First, you have shown us two EditText
s referenced by password
ans vpassword
identifiers but getting the password text from a different EditText
referenced by first
identifier...
may be you want to do like this...
EditText password = (EditText)findViewById(R.id.password);
String password2 = password.getText().toString();
EditText vpassword = (EditText)findViewById(R.id.vpassword);
String vpassword2 = vpassword.getText().toString();
second, don't use ==
operator when comparing Strings. use equals()
method...
vpassword2.equals(password2);