Multi-Selection-Spinner-Android
Multi-Selection-Spinner-Android copied to clipboard
How can you retrieve the selected item on Multiple Select in Spinner
So i recently use this package for my projects, and i used it for filtering function and it is work well, thanks!
//SiteCode Spinner
siteSpinner = dialog?.findViewById<MultiSpinner>(R.id.spnSiteCode)
// populate with data from API
siteSpinner!!.setAdapterWithOutImage(activity,ddlVal,this)
siteSpinner!!.initMultiSpinner(activity,siteSpinner)
override fun OnMultiSpinnerItemSelected(chosenItems: MutableList<String>?) {
//This is where you get all your items selected from the Multi Selection Spinner :)
for (i in chosenItems!!.indices){
//Fill the model with the selected item
fm!!.setStCode(chosenItems)
}
}
and my main problem is how can i retrieve the selected data from the spinner with model in this case ? like this method i used before spinnerObject.setSelection(INDEX_OF_THE_ITEM).
Thank you