Tips discovered while using Android spinners : setting selected item and finding objects in arrays in Java

To set a selected item programmatically in Android Spinner, you should use setSelection method.

To get an index of an item to select from an array of strings using IndexOf, you should first use java.util.Arrays.asList method.

Complete code:

Leave a Reply

Your email address will not be published. Required fields are marked *