15

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?

Mark Schultheiss
  • 32,614
  • 12
  • 69
  • 100
steve
  • 594
  • 4
  • 10
  • 23
  • 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 Answers2

11

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?

Community
  • 1
  • 1
Aleadam
  • 40,203
  • 9
  • 86
  • 108
  • 1
    Thanks , I'm going to give it a try ! – steve May 26 '11 at 08:51
  • 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
7

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/

anupam sharma
  • 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