0

I have a Spinner dropdown with 3 items (they represent dates that can be selected).

  • Now
  • Weekend
  • Custom Date

'Custom Date' is special, when I select it I display a DatePickerDialog. The problem is that when 'Custom Date' is already selected I cannot display again the DatePickerDialog.

SetOnItemSelectedListener fires only when you change selection, I tried OnItemClickListener but I get the exception

setOnItemClickListener cannot be used with a spinner.

Any way to detect the click/select event even when you don't change selection?

Thanks

albert
  • 1,493
  • 1
  • 15
  • 33

1 Answers1

0

Some below you are excepting?

Spinner mySpinner = (Spinner)findViewbyId(R.id.spinner);
int position = mySpinner.getSelectedItemPosition(); 
String Text = yourCityList[position].toString();

String text = mySpinner.getSelectedItem().toString();
NikhilReddy
  • 6,904
  • 11
  • 38
  • 58