Multi-Selection-Spinner-Android icon indicating copy to clipboard operation
Multi-Selection-Spinner-Android copied to clipboard

How can you retrieve the selected item on Multiple Select in Spinner

Open RmdhnRio opened this issue 2 years ago • 0 comments

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

RmdhnRio avatar Oct 18 '22 09:10 RmdhnRio