I have a spinner that acts like a filter for searching among several categories. But the problem is that the spinner allows only one category to select from. Is there a way to obtain a multiple selection behavior for the spinner, or what other alternatives exists?
-
http://chrisblunt.com/2011/03/01/android-spinner-like-ui-for-selecting-multiple-options/ – Greg Dan Jul 02 '11 at 19:02
-
possible duplicate of [Android Spinner with multiple choice](http://stackoverflow.com/questions/5015686/android-spinner-with-multiple-choice) – Dan Hulme Oct 22 '13 at 11:21
-
stuck in same can anyone help http://stackoverflow.com/questions/29446088/how-to-get-spinner-values-in-textview/29487383?noredirect=1#comment47175570_29487383 – Apr 08 '15 at 13:44
-
https://stackoverflow.com/a/47284385/1140304 – Milad Ahmadi Nov 14 '17 at 11:25
2 Answers
S spinner is designed to show one item at a time. You might get away by making a spinner of checkboxes, but it will be probably an awful user experience.
I would suggest you a ListView instead and CHOICE_MODE_MULTIPLE. You can add a listview to a dialog as shown in this answer: is it possible to create listview inside dialog?
-
1
-
stuck in same can anyone help http://stackoverflow.com/questions/29446088/how-to-get-spinner-values-in-textview/29487383?noredirect=1#comment47175570_29487383 – Apr 08 '15 at 13:44
Android provides Spinner widget which has functionality similar to drop-down list. But Spinner accepts single selection. so we select only one item at a time.so We can achieve multi-select feature using a custom Pop-up Window with a multi-select list. Pop-up window is similar to Dialogs except that a pop-up window can be positioned.
When the drop-down button is clicked a list will be displayed(as drop-down), then you can select multiple values. The selected values will be displayed in a Text box above the list.
for reference you can prefer this link:
http://asnehal.wordpress.com/2012/04/03/multi-select-drop-down-list-in-android/

- 1,705
- 17
- 13
-
stuck in same can anyone help http://stackoverflow.com/questions/29446088/how-to-get-spinner-values-in-textview/29487383?noredirect=1#comment47175570_29487383 – Apr 08 '15 at 13:44