Skip to content

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

@RmdhnRio

Description

@RmdhnRio

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions