I want to pass a string from one activity to another, then use the string in a conditional statement. the code below does this but the if statement in the 2nd activity does not execute the code? any ideas why as the BoxTicked string contains the string "true"
String BoxTicked = "true";
Intent i = new Intent(getApplicationContext(), secondActivity.class);
i.putExtra("BoxTicked", BoxTicked);
startActivity(i);
(2nd Activity)
Intent i = getIntent();
String s = i.getStringExtra("BoxTicked");
if(s == "true") {
// Do something
}