title: Cannot be resolved or is not a field with Android spinners
body: <p>I am trying to learn how to implement a simple spinner program to test how they work.  I am getting numerous errors on the R.ID portion and the R.Array values after them.  I get the error that they cannot be resolved or are not a field.  Not sure if the <code>&lt;resource&gt;</code>s belong in manifest.xml or the layout .xml.</p>
  
  <p>Java code:</p>
  
  <pre><code>package com.example.androidassignment2_3;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  import android.widget.ArrayAdapter;
  
  public class Spinner extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_android_spinner);
  
  
          Spinner spinner = (Spinner) findViewById(R.id.activity_android_spinner);
          // Create an ArrayAdapter using the string array and a default spinner layout
          ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this,
                  R.array.planets_array, android.R.layout.simple_spinner_item);
          // Specify the layout to use when the list of choices appears
          adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          // Apply the adapter to the spinner
          spinner.setAdapter(adapter);
      }
  
      private void setAdapter(ArrayAdapter&lt;CharSequence&gt; adapter) {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.spinner, menu);
          return true;
      }
  
  }
  </code></pre>
  
  <p>layout xml</p>
  
  <pre><code>&lt;Spinner
      android:id="@+id/planets_spinner"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" /&gt;
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;string-array name="planets_array"&gt;
          &lt;item&gt;Mercury&lt;/item&gt;
          &lt;item&gt;Venus&lt;/item&gt;
          &lt;item&gt;Earth&lt;/item&gt;
          &lt;item&gt;Mars&lt;/item&gt;
          &lt;item&gt;Jupiter&lt;/item&gt;
          &lt;item&gt;Saturn&lt;/item&gt;
          &lt;item&gt;Uranus&lt;/item&gt;
          &lt;item&gt;Neptune&lt;/item&gt;
      &lt;/string-array&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>manifest xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.androidassignment2_3"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;resources&gt;
      &lt;string-array name="planets_array"&gt;
          &lt;item&gt;Mercury&lt;/item&gt;
          &lt;item&gt;Venus&lt;/item&gt;
          &lt;item&gt;Earth&lt;/item&gt;
          &lt;item&gt;Mars&lt;/item&gt;
          &lt;item&gt;Jupiter&lt;/item&gt;
          &lt;item&gt;Saturn&lt;/item&gt;
          &lt;item&gt;Uranus&lt;/item&gt;
          &lt;item&gt;Neptune&lt;/item&gt;
      &lt;/string-array&gt;
  &lt;/resources&gt;
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="17" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.example.androidassignment2_3.Spinner"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>