Android : Fill Spinner From Java Code Programmatically

Viewed 120436

How do you fill a spinner from java code programmatically?

I have a spinner in the layout like this:

 <Spinner
     android:id="@+id/consultation_deseases"
     android:layout_width="@dimen/bigSpinnerWidth"
     android:layout_height="@dimen/bigSpinnerHeight"
     android:prompt="@string/disease_prompt" />

With java code I need to create the adapter and add the items.

2 Answers
Related