title: Android Spinner and findViewbyID
body: <p>I am trying to create a spinner and am following the instructions from a you tube tutorial. This is what I have in my XML:</p>
  
  <pre><code>  &lt;Spinner
          android:id="@+id/spinner1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView1"
          android:layout_alignTop="@+id/textView1" /&gt;
  </code></pre>
  
  <p>I am trying to refer to it in the MainActivity in the following way:</p>
  
  <pre><code>spinner =(Spinner) findViewById(R.id.spinner1);
  </code></pre>
  
  <p>But I am getting the following message:</p>
  
  <p>spinner1 cannot be resolved or is not a field</p>
  
  <p>I know this is to do with the fact that spinner is not being created in the R.Java file, but I do not understand why it is not being created, or how to fix it.</p>
  
  <p>I am having a similar problem with the strings file:</p>
  
  <pre><code>  &lt;String-array name ="days"&gt;
  
          &lt;item&gt;Sunday&lt;/item&gt;
          &lt;item&gt;Monday&lt;/item&gt;
                  &lt;item&gt;Tuesday&lt;/item&gt;
                  &lt;item&gt;Wednesday&lt;/item&gt;
                  &lt;item&gt;Thursday&lt;/item&gt;
                  &lt;item&gt;Friday&lt;/item&gt;
                  &lt;item&gt;Saturday&lt;/item&gt;
  
      &lt;/String-array&gt;
  </code></pre>
  
  <p>the Java code is:</p>
  
  <pre><code>ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.days, android.R.layout.simple_spinner_item);
  </code></pre>
  
  <p>and I get the following error in the Strings file:</p>
  
  <p>error: Found tag String-array where item is expected</p>