Selecting a particular item from a spinner

Asked

Viewed 630 times

0

What method makes a spinner to be with a selected item, e.g.: I have the items: 1 2 3 and 4

and I want it to start with the '3' selected

1 answer

1


Once you created programmatically or got your Spinner through a layout, just use the method setSelection passing the desired position as parameter:

spinner.setSelection(2);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.