I've done quite a bit of string comparisons in java in the past, but this time it doesn't seem to work.
I'm aware of the fact, that you have to use the .equals() function in order to compare strings in java.
In my attempt to figure out what's wrong, I wrote the following code snippet:
Log.e("testLogic", String.valueOf(taken.getText().toString().trim().equals('1')));
Log.e("testValue", taken.getText().toString().trim());
producing the following result:
E/testLogic﹕ false
E/testValue﹕ 1
E/testLogic﹕ false
E/testValue﹕ 1
E/testLogic﹕ false
E/testValue﹕ 0
This seems rather strange, since the two first 'testLogic' logs should produce true.
The code is used in a custom list adapter if it means anything.
/Mikkel
'1'is achar, not aString. It is not unusual behavior for anequals()method to return false if you hand it some other class.'1'with"1"in other words.