yang
yang

Reputation: 508

Android: How to change spinner's selection with a button?

There are a spinner and a button. When the button is clicked, I want the spinner to select some other option other than the one it currently holds. How may I do that? Thanks.

Upvotes: 1

Views: 536

Answers (1)

Ramseys
Ramseys

Reputation: 431

you should use setSelection(index); on your spinner where index is the index of the option in the options list from your button.onClick().

Upvotes: 3

Related Questions