In my application i got two edit boxes,one is editPassword and other is editConfirmpassword.i want to compare data between those two boxes that both values are equal and only if they are equal then only write data in sharedpref file.
Try this:
EditText e1 = (EditText)findViewById(R.id.editPassword);
EditText e2 = (EditText)findViewById(R.id.editConfirmpassword);
if(e1.getText().toString().equals( e2.getText().toString())){
//do things if these 2 are correct.
}
Use string comparison here. You can fetch the EditText value using getText().toString();
Now you can do a compare using compareToIgnoreCase
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With