I am trying to check user's inserted password with saved password in the database.
This is my methode:
private Boolean CheckPassword()
{
TextView txt_pass = (TextView) findViewById(R.id.login_password_txt);
String _writtenPassword = txt_pass.getText().toString().trim();
if (_writtenPassword == userPassword)
return true;
Log.d(TAG, userPassword);
Log.d(TAG, _writtenPassword);
Log.d(TAG, String.valueOf(userPassword.length()));
Log.d(TAG, String.valueOf(_writtenPassword.length()));
return false;
}
The log shows me the password and length.
The result is:
123
123
3
3
But this methode returns False!!!
Can anyone help me please?