I was trying to do a multiple choice spinner by following code. I am
able to see multiple check boxes wile the spinner is clicked. But I
cant select more than one. Secondly, how can I get all the values
selected ? I saw List11 and List14 examples in ApiDemo, but that is
ListActivity, I dont want to switch to another activity just for this
mundane task.
thanks for any help
private Spinner spinner = null;
spinner = (Spinner) findViewById(R.id.spinner);
ArrayAdapter<CharSequence> adapter = null;
adapter = ArrayAdapter.createFromResource(this,
R.array.values,
android.R.layout.simple_list_item_multiple_choice);
adapter.setDropDownViewResource
(android.R.layout.simple_list_item_multiple_choice);
spinner.setAdapter(adapter);
<Spinner android:id="@+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/prompt" />
<resources>
<string-array name="values">
<item>Red</item>
<item>Green</item>
<item>Blue</item>
</resources>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en