Sunday, 1 September 2013

Spinner with multiple selection in Android

Video Output:



Source code link is added below.

Here we have a class called MultiSelectionSpinner.

In this class we have following methods.


  • public void setItems(String[] items)


    Used to set adapter items using array of strings to this spinner.
  • public void setItems(List items)


    Used to set adapter items using list of strings to this spinner.
  • public void setSelection(String[] selection)


    Used to set selected items on this adapter using array of strings to this spinner.
  • public void setSelection(List selection)


    Used to set selected items on this adapter using list of strings to this spinner.
  • public void setSelection(int index)


    Used to set single selected item using position to this spinner.
  • public void setSelection(int[] selectedIndices)


    Used to set selected items using array of integers to this spinner.
  • public List getSelectedStrings()


    Used to get the selected items as a string
  • public List getSelectedIndices()


    Used to get the selected indexes as a list of integers


  • I hope this post is useful to you. kindly share your feedback as comment here.



    Source code on GitHub



    Thank You