Android Question Spinner Text auto select

Abílio Magalhães

Member
Licensed User
Longtime User
Hello, I've been searchin for a while and didn't found any answer to my question, as it goes:

I've a couple of spinners in my Activity.

When I lauch the activity, I'll do some database queries and return some values, as I use to set the spinner position correcly.

For now, I can do this really easy, but my issue is that if I call for example the spinner_ItemClick(3, "blabla") and spinner will click on that item row, but the spinner text doesn't change, it stays with the text of the position 0.

Ex:
Position 0 text = "blabla"
Position 1 text = "bleble"
Position 2 text = "blibli"
Position 3 text = "blublu"
(...)

I call the click event for the position 3, and the event is raised normally but the text doesn't change, as if I clicked physically on the row.

The text of spinner will still be 'blabla'

Is there a way that the text change calling the ItemClick event from outside the click itself?

Regards.
 
Last edited:

eurojam

Well-Known Member
Licensed User
Longtime User
to set the spinner to an entry use:
B4X:
myspinner.SelectedIndex=1
set's it to the second entry
 
Upvote 0
Top