1

I have a spinner in an Activity, the spinner is hidden initially, but when I load the items into it I initially set the selected item to the index 1, like this:

spinner.setSelection(1);

This triggers the item selected listener only if the spinner is not hidden, but if I hide it (I need to hide it initially to show a progressbar while I load some data) then the listener is not called.

Is there a way I can force the event to dispatch?

Escobar5
  • 3,941
  • 8
  • 39
  • 62

1 Answers1

2

Change visibility from View.GONE to View.INVISIBLE- invisible takes Screen space,which means android takes it into account but its just not visible to the user or set alpha on your View or ViewGroup

Elltz
  • 10,730
  • 4
  • 31
  • 59