I am making a currency converter with two spinners. I want to make an \"if\" function using the values of the spinner\'s selected item like below.
@Over
Try this :
if (spinner1.getSelectedItem().toString().equals("Dollars") && spinner2.getSelectedItem().toString().equals("Euros") ...
getSelectedItem() returns an Object . info . So you have to get the corresponding string first. Then java compares strings using equals().
Object
equals()