MultiSelectSpinner icon indicating copy to clipboard operation
MultiSelectSpinner copied to clipboard

update text value when using setSelection

Open psohm opened this issue 10 years ago • 3 comments

when we use the control and we check for example 2 checkbox. the following value is written : text1, text2

is it possible to show that value when we call a MultiSelectSpinner when calling setSelection ?

regards

psohm avatar Mar 15 '15 23:03 psohm

Same here restrictionCategory.setSelection(selectedCategories); marks items as checked, but the spinner doesnt show the selected items texts

ghost avatar Feb 03 '16 17:02 ghost

You can rebuild the adapter at the end of the setSelection methods in order to achieve that:

_proxyAdapter.clear();
_proxyAdapter.add(buildSelectedItemString());

@psohm @RonEskinder

jimutt avatar Jan 12 '17 11:01 jimutt

    public void refreshSpinner(){
        _proxyAdapter.clear();
        _proxyAdapter.add(buildSelectedItemString());
    }
        String[] strings = { "Red", "Blue", "Green" };
        MultiSelectSpinner mySpin = (MultiSelectSpinner)findViewById(R.id.spinner_options);
        mySpin.setItems(strings);
        mySpin.setSelection(new int[] {1,2});
        mySpin.refreshSpinner();

ndubbaka avatar Jun 24 '19 13:06 ndubbaka