Possible Duplicate:
How do I compare strings in Java?
spinner If Strings** == not working
public void btnRecordTrip_Clicked(View v)
{
Button b = (Button)v;
String currentText = b.getText().toString();
if (currentText == "Record Trip")
The value of currentText is "Record Trip" yet the it compares unequal. I tried .trim() with the same result. The two strings are equal but they compare unequal. What's going on?