This question already has an answer here:
- What is the difference between == vs equals() in Java? 23 answers
- How do I compare strings in Java? 23 answers
while testing Java/Android app in Android Studio I got unexpected behaviour. So I stepped through and found this strange "if" evaluation (see this debugger screenshot ).
It seems to evaluate ("123" == "123") to false...???
The "UserName" parameter is the content of an EditText control. The function "Login" is called here:
clsNAV.Login(EdUser.getText().toString(), EdPassword.getText().toString(),
new clsNAV.cbkLoginResult() { (...)
Of course I did not enter any invisible characters to the EditText (at least not knowingly).
Aucun commentaire:
Enregistrer un commentaire