Put Enums from xml to Spinner

jonathanrai

New Member
I have a problem with spinner in android, I cant set enum values to its content. Here is code of spinner :\[code\]<Spinner android:id="@+id/spTrainingType" android:layout_width="match_parent" android:layout_height="match_parent" android:entries="@attr/TrainingType" android:prompt="@string/hint_training_type" />\[/code\]And here is enum : \[code\]<declare-styleable name="TrainingStyle"> <attr name="RecallType"> <enum name="Vibro" value="http://stackoverflow.com/questions/10395533/1" /> <enum name="Music" value="http://stackoverflow.com/questions/10395533/2" /> <enum name="Silent" value="http://stackoverflow.com/questions/10395533/3" /> <enum name="Alarm" value="http://stackoverflow.com/questions/10395533/4" /> </attr> <attr name="RepeatType"> <enum name="Daily" value="http://stackoverflow.com/questions/10395533/1" /> <enum name="Weekly" value="http://stackoverflow.com/questions/10395533/2" /> <enum name="Monthly" value="http://stackoverflow.com/questions/10395533/3" /> </attr> <attr name="TrainingType"> <enum name="Jogging" value="http://stackoverflow.com/questions/10395533/1" /> <enum name="Cross" value="http://stackoverflow.com/questions/10395533/2" /> <enum name="Climbing" value="http://stackoverflow.com/questions/10395533/3" /> <enum name="BikeTrip" value="http://stackoverflow.com/questions/10395533/4" /> </attr></declare-styleable>\[/code\]So is there any way to put enums to spinner, or only arrays? Or may be i'm doing smth wrong.Thanks in advance.
 
Back
Top