Android spinner prompt text not showing
<p>The first year from the data array is shown instead of the text from prompt in my spinner. I tried adding the prompt in XML, but I also tried from code. Furthermore, it gives me a "resource not found error", when adding the spinnerSelector attribute.</p>

<h3>XML</h3>

<pre><code>&lt;Spinner
    android:id="@+id/spinnerYear"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:layout_marginLeft="10dip"
    android:layout_marginRight="10dip"
    android:drawSelectorOnTop="true"
    android:padding="5dip"
    android:prompt="@string/spinner_header"
    android:background="@drawable/selector_yearspinnerback"
    android:layout_below="@+id/linearLayout_gender_btns"
    android:layout_centerHorizontal="true"&gt;&lt;/Spinner&gt;
  -- android:spinnerSelector="@drawable/category_arrow"
</code></pre>

<h3>Code</h3>

<pre><code>ArrayList&lt;String&gt; yearList = new ArrayList&lt;String&gt;();
int now = new Date().getYear() + 1900;
for (int i = now; i &gt; now - 110; i--) {
    yearList.add(i + "");
}
Spinner spinner = (Spinner) findViewById(R.id.spinnerYear);
ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, yearList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
</code></pre>
