title: Populate Spinner from string array source, with a String ArrayAdapter
body: <p>I have created my application by populating spinners within my Java code. I am now trying to convert it to populating my Spinners from my strings.xml file. I have followed a few websites( <a href="http://developer.android.com/guide/topics/ui/controls/spinner.html" rel="nofollow">example 1</a> and <a href="http://www.dcpagesapps.com/developer-resources/android/21-android-tutorial-spinners?showall=1" rel="nofollow">example 2</a> ), but have not been able to get my code to work. </p>
  
  <p>The main problem with those is that the ArrayAdapter's they use are of type <code>&lt;CharSequence&gt;</code>. Can I do this somehow using <code>&lt;String&gt;</code> ArrayAdapters? </p>
  
  <p>This is my array in my XML file : </p>
  
  <pre><code>&lt;string-array name="anti_pump_ap_mode_array"&gt;
      &lt;item&gt;OFF&lt;/item&gt;
      &lt;item&gt;Anti-Pump&lt;/item&gt;
      &lt;item&gt;Motor Cut...&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p>Here is the code I've tried : </p>
  
  <pre><code>apModeAdapter = new ArrayAdapter&lt;String&gt;(this, R.array.anti_pump_ap_mode_array, android.R.layout.simple_spinner_item );
  
  apModeAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, R.array.anti_pump_ap_mode_array );
  
  apModeAdapter = ArrayAdapter.createFromResource(this, android.R.layout.simple_spinner_item, R.array.anti_pump_ap_mode_array );
  </code></pre>
  
  <p>Of course the last one gives me an error, but the first two just do not populate my spinner. When I run the application the Spinner is just empty. </p>