Expand/open a spinner on click of another item/widget? Expand/open a spinner on click of another item/widget? android android

Expand/open a spinner on click of another item/widget?


Just call Spinner.performClick() to expand Spinner without user interaction...

    final Spinner spinner = (Spinner) findViewById(R.id.spinner);    Button okButton = (Button) findViewById(R.id.yesButton);    okButton.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            if(spinner.getSelectedItem() == null) { // user selected nothing...                spinner.performClick();            }        }    });


Put in your view.onClick

YourSpinner.PerformClick();