This question already has an answer here:
- How to make an Android Spinner with initial text “Select One” 36 answers
I am very new to android development and I seem to have an issue that I cannot understand. I have a spinner and the values are getting set just fine but my prompt is not appearing. I have attempted to set this in both the xml and the java code and neither one works at all. Below is my configuration. I feel that I am missing something fundamental but I don't know what it is yet.
Any help would be appreciated. Craig
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000" >
<Spinner
android:id="@+id/band"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginTop="72dp"
android:prompt="@string/year_prompt"
android:textColor="#F0F0F0" />
<Spinner
android:id="@+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="28dp"
android:entries="@array/year_array"
android:prompt="@string/year_prompt"
android:textColor="#F0F0F0" />
</RelativeLayout>
<string name="year_prompt">Select A Year</string>
<string-array name="year_array">
<item >2000</item>
<item >2001</item>
<item >2002</item>
<item >2003</item>
<item >2004</item>
<item >2005</item>
</string-array>