title: Set selected spinner item based on a name, not a position in Android
body: <p>I have three spinners in an activity where I can edit information that the user has already entered into a database. I have been able to set the text of a textfield by querying my SQLite database to match what the user can edit. Can the same be done with a spinner?</p>
  
  <p>For example, if a user picked the year 2000 previously, in the new edit activity I want the spinner to be already selected at 2000 and then they can change this if they want to.</p>
  
  <p>So far I have only seen options to set positions of spinners based on an integer position. Can this be done by providing a year? Thanks for any help.</p>
  
  <p>Here's what I am currently working on with my month spinner:</p>
  
  <pre><code>ArrayList&lt;String&gt; list = new ArrayList( Arrays.asList(getResources().getStringArray(R.array.months)) );
  int pos = list.get("March");
  spinMonth.setSelection(pos);
  </code></pre>