I got a Spinner in my app and it does not work when an item is clicked. I get the values but the if condition is not getting worked.
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
Object item = parent.getItemAtPosition(pos);
String Text = effecttwo.getSelectedItem().toString();
System.out.println("spinner is -"+item+"-");
// I get the correct values in System.out.println
if(Text=="Hue"){
// not entering into this condition or any other condition
}else if(Text=="Saturation"){
}else if(Text=="Brightness"){
}else{
}
}
public void onNothingSelected(AdapterView<?> parent) {
}
});
Please suggest me what I am doing wrong.