I am using a spinner whose adapter is dynamically populated.
- When there are multiple items, the spinner behavior is the standard one. On a click, the dropdown is showed, allowing the user to select an item
- When there is only one item, I want to prevent the dropdown to appear and catch the click event to perform an action.
I can’t find a solution to prevent the default behavior (i.e. showing the dropdown for only one item on a click). Any ideas on how to do this?
Thanks
hm… try to use
setClickable(fasle)orsetEnabled(false)if only one item inspinner.Try this