Hi I have an array that stores when radio buttons are checked so that when I load the radio settings again I can set the apporpriate one as checked.
My array is like this :
|0 |1 |2
----------------------------------
0 |Option1 |data |false
----------------------------------
1 |Option2 |data |true
----------------------------------
2 |Option3 |data |false
----------------------------------
3 |Option4 |data |false
etc....
Now the index I am interested in is the true/false one as that tells me if that radio button should be checked.
I read these values from a database into the array. That's all working fine and the data is in the array correctly.
For some reason when I do a comparison it does not match it up with what I can see is correct.
This is what I am doing in a loop...
String checked = myarray[i][2];
// This correctly outputs 'false', 'true', 'false' and 'false' as per the array above.
Toast.makeText(DatabaseTestActivity.this, checked, Toast.LENGTH_LONG).show();
// Now when it gets here it fails to trigger the match for 'true'.
if (checked == "true") {
active = i;
Toast.makeText(DatabaseTestActivity.this, "Found Check", Toast.LENGTH_LONG).show();
}
Any idea on what I am doing wrong ? It's just a simple string compare, or so I thought ??