I have Spinners that I am using in my application. They are working fine with one exception. I have set prompts for each one, but they are not showing. I am setting ArrayAdapters
to the Spinners during onCreate
, and my guess is that the setAdapter
method is automatically setting the selection to position 0. Is there a way to set the prompt and have it work as expected?
Here is a code piece:
From the layout file:
<Spinner android:id="@+id/selPunter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:prompt="@string/select_quarterback_prompt"
android:layout_marginLeft="20sp"
android:layout_marginRight="20sp" />
From activity:
offenseList = new ArrayAdapter<PlayerVO>(this,
R.layout.select_item_closed,
gdm.getPlayersByTeamId(offenseId));
offenseList.setDropDownViewResource(R.layout.select_item);
selKicker.setAdapter(offenseList);