I have a spinner widget that only has one item by default, "Create new..."
My problem is if there is only one item in the spinner list, it's already selected, so clicking on it again doesn't trigger anything.
Is there any way to detect when an item is re-selected?
Thanks.
Related
Like this
I want to select an item from this spinner but i can't detect any item from it.
and i used AccessibilityNodeInfo.ACTION_SET_TEXT but it doesn't work
Is there a way to scroll spinner's dropdown list to top so first item is visible regardless which item is currently selected?
Obviously I need only to make vistible the item in the list without any selection.
ListView has smoothScrollToPosition() method to display a specific item in the list but spinner seems not to have a similar behavior.
I want to make custom spinner in which user can select one of the items on dropdown list (like in normal spinner) but I want to prevent from closing (collapsing/dismiss) dropdown list after item selection. Or closing dropdown when user tap two times on item instead of single tap. Is anyone here knows how to achive such behavior using spinner?
Set itemSelectedListener on your spinner and onItemSelected() run this code
spinner.setClickable(false);
When I click on the first item in the spinner, or the default one, the spinner just collapses. All other items perform desired action. How do I get the first item to fire an action?
You are having this problem (assuming you have implemented the setOnItemSelectedListener() for the Spinner) because Spinner calls the onItemSelected() only when you change the Selection, in other words select a new item in the Spinner. Hence the Spinner simply collapse when you select the default selection.
Hope this explanation helps.
I have a created a spinner for my application in android. How can I add a small button (or clickable image) at each item in which when you click on it, it takes you down one items in the spinner? Kinda of like "get me the next item " button without having to expand the whole list.
Thank you very much
An example is, I have my spinner
item 1_______arrowDown
item 2_______arrowDown
item 3_______arrowDown
So when you click on item 1, then this is the selected item. But when you click on arrowDown of item1, it chooses item2 as the selected value. If you click on arrowDown of item 2 then it chooses item 3 as the selected value. arrowDown can be a button or clickable image.
set DropDown resource of spinner to a xml file add button in that file