I have used Spinner to display toast on particular item selected in Spinner.
I am displaying toast when "other" is selected in Spinner. I have done it as below :
spinnerTemp=(Spinner)findViewById(R.id.spinnerTemp);
spinnerTemp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if(spinnerTemp.getSelectedItem().toString().equals("other")){
Toast.makeText(SocialLoginActivity.this, "Displayed", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
The issue is When I am selecting "other" for the first time, toast is displaying.. : FINE. Now, on the spot If i select "other" again, then toast is not displaying. Why ?
Now, if i select some other value and try again selecting "other", its working fine. Issue is with the selecting "other" one after another.
What might be the issue ?
Thanks.