I'm using a checkbox on an activity to determine what List needs to have the object added to it.
Intent i = getIntent();
String intentFlag = i.getStringExtra("flag");
if(listFlag.isChecked() && intentFlag == "main"){
newProduct.put("shoppingList", true);
newProduct.put("mainList", true);
} else if (listFlag.isChecked() && intentFlag == "shoppingList"){
newProduct.put("mainList", true);
newProduct.put("shoppingList", true);
} else if (!listFlag.isChecked() && intentFlag == "main"){
newProduct.put("mainList", true);
newProduct.put("shoppingList", false);
} else if (!listFlag.isChecked() && intentFlag == "shoppingList"){
newProduct.put("mainList", false);
newProduct.put("shoppingList", true);
}
At the moment, the only intentFlag
that can be returned from the Intent
is "main"
, however, code within the IF statement is never reached. Looking at the Debug, it's returning "main"
Am I doing something obviously wrong?